saribasmetehan
commited on
Update README.md
Browse files
README.md
CHANGED
@@ -12,6 +12,8 @@ language:
|
|
12 |
- tr
|
13 |
datasets:
|
14 |
- winvoker/turkish-sentiment-analysis-dataset
|
|
|
|
|
15 |
---
|
16 |
|
17 |
<!-- This model card has been generated automatically according to the information the Trainer had access to. You
|
@@ -33,49 +35,12 @@ It achieves the following results on the evaluation set:
|
|
33 |
</ul>
|
34 |
|
35 |
## Example
|
36 |
-
```
|
37 |
from transformers import pipeline
|
38 |
text = "senden nefret ediyorum"
|
39 |
model_id = "saribasmetehan/bert-base-turkish-sentiment-analysis"
|
40 |
-
|
41 |
-
preds=
|
42 |
print(preds)
|
43 |
|
44 |
#[{'label': 'LABEL_2', 'score': 0.7510055303573608}]
|
45 |
-
```
|
46 |
-
# Load model directly
|
47 |
-
```markdown
|
48 |
-
from transformers import AutoTokenizer, AutoModelForSequenceClassification
|
49 |
-
|
50 |
-
tokenizer = AutoTokenizer.from_pretrained("saribasmetehan/bert-base-turkish-sentiment-analysis")
|
51 |
-
model = AutoModelForSequenceClassification.from_pretrained("saribasmetehan/bert-base-turkish-sentiment-analysis")
|
52 |
-
```
|
53 |
-
## Training procedure
|
54 |
-
|
55 |
-
### Training hyperparameters
|
56 |
-
|
57 |
-
The following hyperparameters were used during training:
|
58 |
-
- learning_rate: 5e-05
|
59 |
-
- train_batch_size: 16
|
60 |
-
- eval_batch_size: 16
|
61 |
-
- seed: 42
|
62 |
-
- optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
|
63 |
-
- lr_scheduler_type: linear
|
64 |
-
- num_epochs: 4
|
65 |
-
|
66 |
-
### Training results
|
67 |
-
|
68 |
-
| Training Loss | Epoch | Step | Validation Loss | Accuracy |
|
69 |
-
|:-------------:|:-----:|:----:|:---------------:|:--------:|
|
70 |
-
| 0.1902 | 1.0 | 625 | 0.1629 | 0.9575 |
|
71 |
-
| 0.1064 | 2.0 | 1250 | 0.1790 | 0.96 |
|
72 |
-
| 0.0631 | 3.0 | 1875 | 0.2358 | 0.96 |
|
73 |
-
| 0.0146 | 4.0 | 2500 | 0.2458 | 0.962 |
|
74 |
-
|
75 |
-
|
76 |
-
### Framework versions
|
77 |
-
|
78 |
-
- Transformers 4.40.2
|
79 |
-
- Pytorch 2.2.1+cu121
|
80 |
-
- Datasets 2.19.1
|
81 |
-
- Tokenizers 0.19.1
|
|
|
12 |
- tr
|
13 |
datasets:
|
14 |
- winvoker/turkish-sentiment-analysis-dataset
|
15 |
+
widget:
|
16 |
+
- text: "Bu bir örnek metindir. Lütfen kendi cümlenizi deneyin."
|
17 |
---
|
18 |
|
19 |
<!-- This model card has been generated automatically according to the information the Trainer had access to. You
|
|
|
35 |
</ul>
|
36 |
|
37 |
## Example
|
38 |
+
```python
|
39 |
from transformers import pipeline
|
40 |
text = "senden nefret ediyorum"
|
41 |
model_id = "saribasmetehan/bert-base-turkish-sentiment-analysis"
|
42 |
+
classifier = pipeline("text-classification", model=model_id)
|
43 |
+
preds = classifier(text)
|
44 |
print(preds)
|
45 |
|
46 |
#[{'label': 'LABEL_2', 'score': 0.7510055303573608}]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|