|
|
--- |
|
|
language: tr |
|
|
license: mit |
|
|
--- |
|
|
# turkish-text-classification-model |
|
|
|
|
|
https://huggingface.co/algumusrende/turkish-text-classification-model |
|
|
|
|
|
This model is used for Sentiment Analysis, which is based on bert-base-turkish-sentiment-cased https://huggingface.co/savasy/bert-base-turkish-sentiment-cased |
|
|
|
|
|
## Dataset |
|
|
|
|
|
The dataset is taken from https://www.kaggle.com/datasets/burhanbilenn/duygu-analizi-icin-urun-yorumlari?select=magaza_yorumlari_duygu_analizi.csv |
|
|
|
|
|
Containing product reviews of electronics stores in Turkish Language, with 3 categories: |
|
|
|
|
|
[ |
|
|
"Olumlu (Positive)", |
|
|
"Olumsuz (Negative)", |
|
|
"Tarafsız (Neutral)" |
|
|
] |
|
|
|
|
|
2 columns and 11429 rows (3 NaN rows), encoded in "utf-16" |
|
|
|
|
|
*Dataset* |
|
|
|
|
|
| *size* | *data* | |
|
|
|--------|----| |
|
|
| 5713 |train.csv| |
|
|
| 2856 |val.csv| |
|
|
| 2857 |test.tsv| |
|
|
| *11426* |*total*| |
|
|
|
|
|
## Training and Results |
|
|
|
|
|
|*index*|*eval\_loss*|*eval\_Accuracy*|*eval\_F1*|*eval\_Precision*|*eval\_Recall*| |
|
|
|---|---|---|---|---|---| |
|
|
|train|0\.41672539710998535|0\.8531419569403116|0\.8346503162224169|0\.842628684710363|0\.8315839726920476| |
|
|
|val|0\.6787932515144348|0\.7545518207282913|0\.7277930570101517|0\.7311753495947505|0\.7293434379700242| |
|
|
|test|0\.6885481476783752|0\.7434371718585929|0\.7170880702233838|0\.7189901255561661|0\.7180628887201386| |
|
|
|
|
|
## Code Usage |
|
|
|
|
|
```python |
|
|
from transformers import AutoModelForSequenceClassification, AutoTokenizer, pipeline |
|
|
|
|
|
model = AutoModelForSequenceClassification.from_pretrained("algumusrende/turkish-text-classification-model") |
|
|
tokenizer= AutoTokenizer.from_pretrained("algumusrende/turkish-text-classification-model") |
|
|
pipe = pipeline("sentiment-analysis", model=model, tokenizer=tokenizer) |
|
|
|
|
|
pipe("Son zamanlarda ekonomideki istikrar, borsa endeksine de olumlu yansıdı.") |
|
|
# [{'label': 'Olumlu', 'score': 0.6654265522956848}] |
|
|
|
|
|
pipe("Geçirdiğim diş operasyonu için çekilen röntgen filmleri sağlık yardımı kapsamında ödenmedi.") |
|
|
# [{'label': 'Olumsuz', 'score': 0.9064584970474243}] |
|
|
|
|
|
pipe("Eskiden bayramlarda çikolata dağıtlırdı, artık bunu göremiyoruz.") |
|
|
# [{'label': 'Olumsuz', 'score': 0.7049197554588318}] |
|
|
|
|
|
pipe("Ürün genel itibari ile iyi sayılır, ancak bazı eksikleri de var.") |
|
|
# [{'label': 'Tarafsız', 'score': 0.9369649887084961}] |
|
|
|
|
|
``` |
|
|
--- |