Instructions to use algumusrende/turkish-text-classification-model with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use algumusrende/turkish-text-classification-model with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="algumusrende/turkish-text-classification-model")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("algumusrende/turkish-text-classification-model") model = AutoModelForSequenceClassification.from_pretrained("algumusrende/turkish-text-classification-model", device_map="auto") - Notebooks
- Google Colab
- Kaggle
|
Download README.md from algumusrende/turkish-text-classification-model: direct link, hf CLI and curl.
- Browser
- Download file 2.24 kB
-
https://huggingface.co/algumusrende/turkish-text-classification-model/resolve/main/README.md
- Command line
-
hf download hf://algumusrende/turkish-text-classification-model/README.md
-
curl -L -o README.md https://huggingface.co/algumusrende/turkish-text-classification-model/resolve/main/README.md
2.24 kB
| 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}] | |
| ``` | |
| --- |