Views
No views yet
1from transformers import AutoTokenizer, AutoModelForSequenceClassification
2
3tokenizer = AutoTokenizer.from_pretrained("execbat/bert-finetuned-sst2")
4model = AutoModelForSequenceClassification.from_pretrained("execbat/bert-finetuned-sst2")1from transformers import pipeline
2
3label_tags = {'LABEL_0' : "NEGATIVE",
4 'LABEL_1' : "POSITIVE"}
5
6pipe = pipeline("text-classification", model="execbat/bert-finetuned-sst2")
7result = pipe(["what a horrible day!", "what a wonderfull day!"])
8encoded_result = [label_tags[i["label"]] for i in result]
9print(encoded_result)['NEGATIVE', 'POSITIVE']| Training Loss | Epoch | Step | Validation Loss | Accuracy |
|---|---|---|---|---|
| 0.269 | 1.0 | 8419 | 0.5041 | 0.8716 |
| 0.1854 | 2.0 | 16838 | 0.4296 | 0.8968 |
| 0.0993 | 3.0 | 25257 | 0.3812 | 0.9083 |