Update README.md
Browse files
README.md
CHANGED
|
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: mit
|
| 3 |
+
tags:
|
| 4 |
+
- pytorch
|
| 5 |
+
- text-classification
|
| 6 |
+
- sentiment-analysis
|
| 7 |
+
- chinese
|
| 8 |
+
---
|
| 9 |
+
|
| 10 |
+
# Tiny Sentiment Classifier
|
| 11 |
+
|
| 12 |
+
一个非常小的 Transformer 模型,用于中文情感二分类(正面/负面)。
|
| 13 |
+
|
| 14 |
+
## 使用方式
|
| 15 |
+
|
| 16 |
+
```python
|
| 17 |
+
from transformers import pipeline
|
| 18 |
+
|
| 19 |
+
classifier = pipeline("text-classification", model="你的用户名/tiny-sentiment-classifier")
|
| 20 |
+
|
| 21 |
+
text = "这家店的东西真不错"
|
| 22 |
+
result = classifier(text)
|
| 23 |
+
print(result)
|