savasy/ttc4900
Viewer • Updated • 4.9k • 344 • 5
How to use celalkartoglu/xlm-roberta-ttc4900-merged with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-classification", model="celalkartoglu/xlm-roberta-ttc4900-merged") # Load model directly
from transformers import AutoTokenizer, AutoModelForSequenceClassification
tokenizer = AutoTokenizer.from_pretrained("celalkartoglu/xlm-roberta-ttc4900-merged")
model = AutoModelForSequenceClassification.from_pretrained("celalkartoglu/xlm-roberta-ttc4900-merged", device_map="auto")Bu model, xlm-roberta-base tabanlı olup LoRA (Low-Rank Adaptation) ile TTC-4900 haber veri seti üzerinde ince ayar yapılmıştır.
Amaç: Türkçe haberleri 7 farklı konu başlığına otomatik sınıflandırmak.
| Sınıf | Precision | Recall | F1 |
|---|---|---|---|
| ekonomi | 0.90 | 0.74 | 0.81 |
| siyaset | 0.77 | 0.85 | 0.81 |
| dünya | 0.90 | 0.80 | 0.85 |
| kültür | 0.92 | 0.99 | 0.95 |
| sağlık | 0.96 | 0.99 | 0.97 |
| spor | 0.97 | 0.97 | 0.97 |
| teknoloji | 0.85 | 0.90 | 0.87 |
from transformers import pipeline
pipe = pipeline(
"text-classification",
model="celalkartoglu/xlm-roberta-ttc4900-merged",
tokenizer="celalkartoglu/xlm-roberta-ttc4900-merged",
return_all_scores=True
)
text = "Merkez Bankası faiz oranlarını sabit tuttu."
print(pipe(text))