Update README.md
Browse files
README.md
CHANGED
|
@@ -27,9 +27,20 @@ It achieves the following results on the evaluation set:
|
|
| 27 |
- Accuracy: 0.9189
|
| 28 |
- F1: 0.9415
|
| 29 |
|
| 30 |
-
##
|
| 31 |
|
| 32 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
|
| 34 |
## Intended uses & limitations
|
| 35 |
|
|
|
|
| 27 |
- Accuracy: 0.9189
|
| 28 |
- F1: 0.9415
|
| 29 |
|
| 30 |
+
## 模型實作
|
| 31 |
|
| 32 |
+
```python
|
| 33 |
+
from transformers import pipeline
|
| 34 |
+
|
| 35 |
+
id2_label = {'LABEL_0':"負評",'LABEL_1':"正評"}
|
| 36 |
+
pipe = pipeline('text-classification', model="roberthsu2003/for_classification")
|
| 37 |
+
|
| 38 |
+
sen="服務人員都很親切"
|
| 39 |
+
print(sen,id2_label[pipe(sen)[0]['label']])
|
| 40 |
+
|
| 41 |
+
sen1="服務人員都不親切"
|
| 42 |
+
print(sen1,id2_label[pipe(sen1)[0]['label']])
|
| 43 |
+
```
|
| 44 |
|
| 45 |
## Intended uses & limitations
|
| 46 |
|