Gorengoz/bert-turkish-sentiment-analysis-cased
133
Bu model https://github.com/stefan-it/turkish-bert'in; aşağıdaki 3 kategorinin olduğu metin sınıflandırma verilerine göre fine-tuned edilmiş halidir.
code_to_label={
'LABEL_0': 'olumlu ',
'LABEL_1': 'nötr ',
'LABEL_2': 'olumsuz' }
Eğitim ve validasyon verisi
Fine-tune işlemi için Gorengoz/tr-customerreview veri seti kullanılmıştır.
Hiperparametreler
modelargs = { "numtrainepochs":3, "overwriteoutput_dir":True}
model = ClassificationModel( 'bert', 'dbmdz/bert-base-turkish-128k-cased', numlabels=3, args=modelargs, weight=[0.1, 0.25,0.65] )
## Eğitim Metrikleri | Epochs | Running Loss | |--- |--- | | 1| 0.0092 | | 2| 0.0087 | | 3| 0.0054 |
Nasıl Kullanılacağı
from transformers import AutoTokenizer, AutoModelForSequenceClassification,pipeline
tokenizer = AutoTokenizer.from_pretrained("Gorengoz/bert-turkish-sentiment-analysis-cased")
model = AutoModelForSequenceClassification.from_pretrained("Gorengoz/bert-turkish-sentiment-analysis-cased")
nlp=pipeline("text-classification", model=model, tokenizer=tokenizer)
code_to_label={
'LABEL_0': 'olumlu ',
'LABEL_1': 'nötr ',
'LABEL_2': 'olumsuz' }
code_to_label[nlp("Ürün berbat, paranıza yazık olur.")[0]['label']]
