Views
No views yet
1from transformers import pipeline
2
3id2_label = {'LABEL_0':"負評",'LABEL_1':"正評"}
4pipe = pipeline('text-classification', model="roberthsu2003/for_classification")
5
6sen="服務人員都很親切"
7print(sen,id2_label[pipe(sen)[0]['label']])
8
9sen1="服務人員都不親切"
10print(sen1,id2_label[pipe(sen1)[0]['label']])| Training Loss | Epoch | Step | Validation Loss | Accuracy | F1 |
|---|---|---|---|---|---|
| 0.2886 | 1.0 | 110 | 0.2269 | 0.9009 | 0.9272 |
| 0.1799 | 2.0 | 220 | 0.2218 | 0.9112 | 0.9356 |
| 0.1395 | 3.0 | 330 | 0.2366 | 0.9189 | 0.9415 |