saribasmetehan
commited on
Update README.md
Browse files
README.md
CHANGED
@@ -35,12 +35,50 @@ It achieves the following results on the evaluation set:
|
|
35 |
</ul>
|
36 |
|
37 |
## Example
|
38 |
-
```
|
39 |
from transformers import pipeline
|
40 |
text = "senden nefret ediyorum"
|
41 |
model_id = "saribasmetehan/bert-base-turkish-sentiment-analysis"
|
42 |
-
|
43 |
-
preds
|
44 |
print(preds)
|
45 |
|
46 |
#[{'label': 'LABEL_2', 'score': 0.7510055303573608}]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
35 |
</ul>
|
36 |
|
37 |
## Example
|
38 |
+
```markdown
|
39 |
from transformers import pipeline
|
40 |
text = "senden nefret ediyorum"
|
41 |
model_id = "saribasmetehan/bert-base-turkish-sentiment-analysis"
|
42 |
+
classifer = pipeline("text-classification",model = model_id)
|
43 |
+
preds= classifer(text)
|
44 |
print(preds)
|
45 |
|
46 |
#[{'label': 'LABEL_2', 'score': 0.7510055303573608}]
|
47 |
+
```
|
48 |
+
# Load model directly
|
49 |
+
```markdown
|
50 |
+
from transformers import AutoTokenizer, AutoModelForSequenceClassification
|
51 |
+
|
52 |
+
tokenizer = AutoTokenizer.from_pretrained("saribasmetehan/bert-base-turkish-sentiment-analysis")
|
53 |
+
model = AutoModelForSequenceClassification.from_pretrained("saribasmetehan/bert-base-turkish-sentiment-analysis")
|
54 |
+
```
|
55 |
+
## Training procedure
|
56 |
+
|
57 |
+
### Training hyperparameters
|
58 |
+
|
59 |
+
The following hyperparameters were used during training:
|
60 |
+
- learning_rate: 5e-05
|
61 |
+
- train_batch_size: 16
|
62 |
+
- eval_batch_size: 16
|
63 |
+
- seed: 42
|
64 |
+
- optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
|
65 |
+
- lr_scheduler_type: linear
|
66 |
+
- num_epochs: 4
|
67 |
+
|
68 |
+
### Training results
|
69 |
+
|
70 |
+
| Training Loss | Epoch | Step | Validation Loss | Accuracy |
|
71 |
+
|:-------------:|:-----:|:----:|:---------------:|:--------:|
|
72 |
+
| 0.1902 | 1.0 | 625 | 0.1629 | 0.9575 |
|
73 |
+
| 0.1064 | 2.0 | 1250 | 0.1790 | 0.96 |
|
74 |
+
| 0.0631 | 3.0 | 1875 | 0.2358 | 0.96 |
|
75 |
+
| 0.0146 | 4.0 | 2500 | 0.2458 | 0.962 |
|
76 |
+
|
77 |
+
|
78 |
+
### Framework versions
|
79 |
+
|
80 |
+
- Transformers 4.40.2
|
81 |
+
- Pytorch 2.2.1+cu121
|
82 |
+
- Datasets 2.19.1
|
83 |
+
- Tokenizers 0.19.1
|
84 |
+
bunu düzenleyip tekrar atar mısın
|