roberthsu2003/data_for_classification
Viewer • Updated • 7.77k • 12
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")# Load model directly
from transformers import AutoTokenizer, AutoModelForSequenceClassification
tokenizer = AutoTokenizer.from_pretrained("roberthsu2003/for_classification")
model = AutoModelForSequenceClassification.from_pretrained("roberthsu2003/for_classification")This model is a fine-tuned version of google-bert/bert-base-chinese on an unknown dataset. It achieves the following results on the evaluation set:
from transformers import pipeline
id2_label = {'LABEL_0':"負評",'LABEL_1':"正評"}
pipe = pipeline('text-classification', model="roberthsu2003/for_classification")
sen="服務人員都很親切"
print(sen,id2_label[pipe(sen)[0]['label']])
sen1="服務人員都不親切"
print(sen1,id2_label[pipe(sen1)[0]['label']])
More information needed
More information needed
The following hyperparameters were used during training:
| 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 |
Base model
google-bert/bert-base-chinese
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="roberthsu2003/for_classification")