Update README.md
Browse files
README.md
CHANGED
@@ -41,3 +41,25 @@ model = ClassificationModel(
|
|
41 |
| 1| 0.0092 |
|
42 |
| 2| 0.0087 |
|
43 |
| 3| 0.0054 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
41 |
| 1| 0.0092 |
|
42 |
| 2| 0.0087 |
|
43 |
| 3| 0.0054 |
|
44 |
+
|
45 |
+
### Nasıl Kullanılacağı
|
46 |
+
|
47 |
+
```
|
48 |
+
from transformers import AutoTokenizer, AutoModelForSequenceClassification
|
49 |
+
|
50 |
+
tokenizer = AutoTokenizer.from_pretrained("Gorengoz/bert-turkish-sentiment-analysis-cased")
|
51 |
+
model = AutoModelForSequenceClassification.from_pretrained("Gorengoz/bert-turkish-sentiment-analysis-cased")
|
52 |
+
|
53 |
+
nlp=pipeline("text-classification", model=model, tokenizer=tokenizer)
|
54 |
+
|
55 |
+
code_to_label={
|
56 |
+
|
57 |
+
'LABEL_0': 'olumlu ',
|
58 |
+
|
59 |
+
'LABEL_1': 'nötr ',
|
60 |
+
|
61 |
+
'LABEL_2': 'olumsuz' }
|
62 |
+
|
63 |
+
code_to_label[nlp("Ürün berbat, paranıza yazık olur.")[0]['label']]
|
64 |
+
|
65 |
+
```
|