• Stars
    star
    143
  • Rank 257,007 (Top 6 %)
  • Language
    Python
  • Created over 6 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Chinese Sentiment Analysis 中文文本情感分析

bixin

Build Status PyPI

Chinese Sentiment Analysis base on dictionary and rules.

CHANGELOG

prior to v0.0.4, bixin depends on cppjieba-py, which requires a c++ 11 compillation makes hard to use, I decided to use jieba_fast.

it will solve the following problems:

  • hard to install the dependency cppjieba-py
  • can't load user dictionary
  • word segment difference from jieba

but it slower than use cppjieba-py

Installation

> pip3 install bixin

Usage

    from bixin import predict
    text ="幸福每时每刻都会像路边的乞丐一样出现在你面前。要是你觉得你所梦想的幸福不是这样的,因而断言你的幸福已死亡,你只接受符合你的原则和心愿的幸福,那么你就会落得不幸。"
    # 出自安德烈·纪德《人间食粮》
    predict(text)
    # sentiment score: 0.42

sentiment score is in the range of -1 to 1

predict will load dictionary data at first time,to load it manually use predict.classifier.initialize()

Accuracy

Test with 6226 taged corpus mixed up with shopping reviews 、Sina Weibo tweets 、hotel reviews 、news and financial news

accuracy: 0.827771

Notice:neutral texts are all ignored.

details about test dataset see wiki 关于测试数据集

Development

> pip3 install -e ".[dev]" git+https://github.com/bung87/bixin

./dictionaries dictionaries from vary sources
./data processed dictionaries through ./scripts/tagger.py
./scripts/release_data.py release data to package

./scripts/score.py

all data archives: https://github.com/bung87/bixin/releases/tag/v0.0.1

run accuray testing with all .txt files under test_data directory sentence per line end with a space and a tag n or p

Test

nosetests -c nose.cfg for single python version
tox for multiple python versions

Acknowledgments

bixin was inspired by dongyuanxin's DictEmotionAlgorithm

Support me

支付宝:

支付宝

License

MIT © bung

More Repositories

1

scorper

scorper is a micro and elegant web framework written in Nim
Nim
67
star
2

ts2nim

Typescript to Nim transpiler
TypeScript
41
star
3

vscode-rails

vscode rails extension,Ruby On Rails "Asset Tag Helpers" and "Form Helpers snippets,.erb syntax highlights,related files Navigation,Go to Definition.
TypeScript
40
star
4

amysql

Async MySQL Connector write in pure Nim.
Nim
25
star
5

crowngui

[WIP]Web Technologies based Crossplatform GUI Framework
Nim
17
star
6

icon

Icon file generator for Windows, macOS, Web
Nim
17
star
7

vscode-nim-lsp

vscode nim extension using LSP server write in nim
TypeScript
12
star
8

datetime_parse

datetime parse in Nim
Nim
10
star
9

parsesql

The parsesql module implements a high performance SQL file parser. It parses PostgreSQL syntax and the SQL ANSI standard.
Nim
9
star
10

rust2nim

Nim
8
star
11

crown_excel

crowngui based excel viewer
Nim
7
star
12

leaflet-searchbox

A google map style search box which includes a side panel slider control
JavaScript
7
star
13

moto-moe

Site source for moto.moe,a pinterest like site.[Deprecated since it's over 3 years]
JavaScript
7
star
14

daemon

python-daemon port to nim
Nim
6
star
15

objc_runtime

objective-c runtime bindings provide macro `objcr` allow you write message sending style code
Nim
6
star
16

sea

search engine write in Nim
Nim
6
star
17

familiapy

Familia python binding using pybind11
Python
5
star
18

workflowProgress.js

a super simple workflow progressbar component for web site
CSS
5
star
19

nginx_supervisor_tornado

a nginx+supervisor+tornado development environment automatically insall and setup tool.
Shell
5
star
20

font-extractor

extract subset of font from text content or website for CJK website
LiveScript
5
star
21

gamode

windows optimization tool for game
Nim
4
star
22

whatlangid

This project is build on top of whatthelang and langid
Python
4
star
23

lsp_client

Nim
4
star
24

slim

nimble fork, handle requires in task and pre test
Nim
4
star
25

vscode-gemfile

vscode extension provide hover link in Gemfile refers to online site.
TypeScript
4
star
26

db_adapter

[WIP] database adapter write in Nim
Nim
4
star
27

parcel-plugin-esbuild

Simple works drop-in replacement for parcel's builtins. Save ~2/3 build time.
JavaScript
4
star
28

sched

port python sched to Nim
Nim
3
star
29

buffer

buffer module write in Nim provide api similar to Nodejs buffer module.
Nim
3
star
30

rednim

simple redis server write in Nim
Nim
3
star
31

assassin

Assassin is a web-based ping,dig,traceroute service.
Python
3
star
32

echarts-soap

echarts-soap is a handy tool for echarts
JavaScript
2
star
33

rcedit

cross-platform rcedit wrapper in Nim.
Nim
2
star
34

webview2

Nim
2
star
35

web_preprocessor

web assets preprocessor compile sass,optimize png,optimize jpg
Nim
2
star
36

django-moe-auth

Integrated set of Django applications(django-allauth,mongoengine,django-rest-framework) authentication, registration,account management.
Python
2
star
37

crown_ui

ui system and static site generator
Nim
2
star
38

proxy

proxy server write in Nim
Nim
2
star
39

luna

luna🌛 is a nim test framework
Nim
1
star
40

oc2dart-vscode-extension

vscode extension provide command , convert Objective-C header to dart.
TypeScript
1
star
41

crowncli

Nim
1
star
42

stage

nim tasks apply to git hooks
Nim
1
star
43

dart2ts

UNMAINTAINED, UNCOMPLETED
Dart
1
star
44

kagami

Programmer tools with Chinese features
Python
1
star
45

pvr-ccz

pure dart lib decode pvr.ccz to Image
Dart
1
star
46

disk_space

flutter plugin Get the information about free and total disk space for you device.
Ruby
1
star
47

ts2nim-vscode-extension

vscode extension provide command , convert Typescript to Nim.
TypeScript
1
star
48

tim_sort

tim sort algorithm implement in Nim.
Nim
1
star
49

zopflipng

zopflipng-like png optimization in Nim
Nim
1
star
50

hello_world

my first android app,share to my friends
Java
1
star
51

MacDevCleaner

Mac disk cleaner for developers base on Flutter
Dart
1
star
52

peatio2

fork of peatio, I dont runs crypto currency exchanges.
Ruby
1
star
53

rxnim

Reactive programing in Nim
Nim
1
star