File size: 3,200 Bytes
e265ffa
 
 
 
 
 
 
 
 
 
 
8fab676
 
 
 
95c4f44
b354986
 
e265ffa
 
 
 
 
 
 
c3b62fe
e265ffa
 
 
 
 
 
 
 
 
 
 
 
 
2123b28
 
 
 
 
b354986
831d834
2123b28
 
 
 
e265ffa
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8fab676
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
---
base_model: HooshvareLab/bert-base-parsbert-uncased
tags:
- generated_from_trainer
metrics:
- precision
- recall
- accuracy
model-index:
- name: Persian-Text-Sentiment-Bert-LORA
  results: []
license: mit
language:
- fa
library_name: peft
pipeline_tag: text-classification
datasets:
- SeyedAli/Persian-Text-Sentiment
---

<!-- This model card has been generated automatically according to the information the Trainer had access to. You
should probably proofread and complete it, then remove this comment. -->

# Persian-Text-Sentiment-Bert-LORA

This model is a Adapter for [HooshvareLab/bert-base-parsbert-uncased](https://huggingface.co/HooshvareLab/bert-base-parsbert-uncased) on [SeyedAli/Persian-Text-Sentiment](https://huggingface.co/datasets/SeyedAli/Persian-Text-Sentiment) dataset in Persian Sentment Analysis Task.
It achieves the following results on the evaluation set:
- Loss: 0.3427
- Precision: 0.8579
- Recall: 0.8543
- F1-score: 0.8540
- Accuracy: 0.8543

## Model description

More information needed

## Intended uses & limitations

This is how to use this model in an example
```python
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('خیلی کتاب خوبی بود')
```

## Training and evaluation data

More information needed

## Training procedure

### Training hyperparameters

The following hyperparameters were used during training:
- learning_rate: 2e-05
- train_batch_size: 16
- eval_batch_size: 16
- seed: 42
- optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
- lr_scheduler_type: linear
- num_epochs: 10

### Training results

| 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   |


### Framework versions

- Transformers 4.35.1
- Pytorch 2.1.0+cu118
- Datasets 2.14.6
- Tokenizers 0.14.1