SeyedAli/Persian-Text-Sentiment
Viewer • Updated • 69.8k • 35 • 4
How to use SeyedAli/Persian-Text-Sentiment-Bert-LORA with PEFT:
from peft import PeftModel
from transformers import AutoModelForSequenceClassification
base_model = AutoModelForSequenceClassification.from_pretrained("HooshvareLab/bert-base-parsbert-uncased")
model = PeftModel.from_pretrained(base_model, "SeyedAli/Persian-Text-Sentiment-Bert-LORA")This model is a Adapter for HooshvareLab/bert-base-parsbert-uncased on SeyedAli/Persian-Text-Sentiment dataset in Persian Sentment Analysis Task. It achieves the following results on the evaluation set:
More information needed
This is how to use this model in an example
from peft import PeftModel
from transformers import pipeline
modelname="SeyedAli/Persian-Text-Sentiment-Bert-LORA"
tokenizer=AutoTokenizer.from_pretrained("HooshvareLab/bert-base-parsbert-uncased")
model=AutoModelForSequenceClassification.from_pretrained("HooshvareLab/bert-base-parsbert-uncased")
model = PeftModel.from_pretrained(model, modelname)
pipe = pipeline("text-classification", model=model,tokenizer=tokenizer)
pipe('خیلی کتاب خوبی بود')
More information needed
The following hyperparameters were used during training:
| 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 |
Base model
HooshvareLab/bert-base-parsbert-uncased