Text Classification
Transformers
Safetensors
Chinese
bert
Generated from Trainer
text-embeddings-inference
Instructions to use roberthsu2003/for_classification with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use roberthsu2003/for_classification with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="roberthsu2003/for_classification")# Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("roberthsu2003/for_classification") model = AutoModelForSequenceClassification.from_pretrained("roberthsu2003/for_classification") - Notebooks
- Google Colab
- Kaggle
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 |
|