Views
No views yet
1from peft import PeftModel
2from transformers import pipeline
3modelname="SeyedAli/Persian-Text-Sentiment-Bert-LORA"
4tokenizer=AutoTokenizer.from_pretrained("HooshvareLab/bert-base-parsbert-uncased")
5model=AutoModelForSequenceClassification.from_pretrained("HooshvareLab/bert-base-parsbert-uncased")
6model = PeftModel.from_pretrained(model, modelname)
7pipe = pipeline("text-classification", model=model,tokenizer=tokenizer)
8pipe('خیلی کتاب خوبی بود')| Training Loss | Epoch | Step | Validation Loss | Precision | Recall | F1-score | Accuracy |
|---|---|---|---|---|---|---|---|
| 0.3939 | 1.0 | 3491 | 0.3835 | 0.8457 | 0.8404 | 0.8398 | 0.8404 |
| 0.3722 | 2.0 | 6982 | 0.3677 | 0.8513 | 0.8457 | 0.8451 | 0.8457 |
| 0.3553 | 3.0 | 10473 | 0.3576 | 0.8539 | 0.8495 | 0.8491 | 0.8495 |
| 0.3618 | 4.0 | 13964 | 0.3525 | 0.8546 | 0.8513 | 0.8509 | 0.8513 |
| 0.3534 | 5.0 | 17455 | 0.3485 | 0.8557 | 0.8521 | 0.8517 | 0.8521 |
| 0.3423 | 6.0 | 20946 | 0.3470 | 0.8562 | 0.8530 | 0.8526 | 0.8530 |
| 0.3455 | 7.0 | 24437 | 0.3453 | 0.8573 | 0.8535 | 0.8531 | 0.8535 |
| 0.347 | 8.0 | 27928 | 0.3428 | 0.8575 | 0.8539 | 0.8535 | 0.8539 |
| 0.344 | 9.0 | 31419 | 0.3429 | 0.8578 | 0.8546 | 0.8542 | 0.8546 |
| 0.335 | 10.0 | 34910 | 0.3427 | 0.8579 | 0.8543 | 0.8540 | 0.8543 |