Metadata-Version: 2.1
Name: bhsenti
Version: 0.0.3
Summary: 基于三分类的中文情感分析
Author-email: bhnw <bhshare.cn@gmail.com>
Project-URL: Homepage, https://github.com/yaokui2018
Project-URL: Bug Tracker, https://github.com/yaokui2018/bhsenti/issues
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
Classifier: Operating System :: OS Independent
Requires-Python: >=3
Description-Content-Type: text/markdown
License-File: LICENSE

## 基于三分类的文本情感分析

基于bert模型，能够识别文本postive, neutral, negative三种情感。

### 安装
`pip install bhsenti`

### 使用

```python 
import bhsenti

pre = bhsenti.predict("待预测文本")
pre_info = bhsenti.predict_info("待预测文本")

print(pre)
# 积极
print(pre_info)
# {'text': '待预测文本', 'result': '积极', 'classes': 2, 'score': [0.3605044484138489, 0.009216712787747383, 0.6302788257598877]}
```
- text: str 接收到的文本,
- result: str 预测结果,
- classes: int 情感类别序号： 0.消极 1.中性 2.积极,
- score: list[double] 每个类别的预测得分
