winvoker/turkish-sentiment-analysis-dataset
Viewer • Updated • 490k • 633 • 48
Here's an updated Model Card in a README format based on the training results and the model you've used (ModernBERT-large for Turkish sentiment analysis):
# Turkish Sentiment ModernBERT-large
This is a fine-tuned ModernBERT-large model for Turkish Sentiment Analysis. The model was trained on the winvoker/turkish-sentiment-analysis-dataset and is designed to classify Turkish text into sentiment categories such as positive, negative, and neutral.
The model was trained for 4 epochs with the following results:
| Epoch | Training Loss | Validation Loss | Accuracy | F1 Score |
|---|---|---|---|---|
| 1 | 0.2884 | 0.1133 | 95.72% | 92.18% |
| 2 | 0.1759 | 0.1050 | 96.24% | 93.33% |
| 3 | 0.0633 | 0.1233 | 96.14% | 93.19% |
| 4 | 0.0623 | 0.1213 | 96.14% | 93.19% |
You can use this model for sentiment analysis of Turkish text. Here’s an example of how to use it:
from transformers import AutoModelForSequenceClassification, AutoTokenizer
import torch
# Load the pre-trained model and tokenizer
model_name = "bayrameker/Turkish-sentiment-ModernBERT-large"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForSequenceClassification.from_pretrained(model_name)
# Example texts for prediction
texts = ["bu ürün çok iyi", "bu ürün berbat"]
# Tokenize the inputs
inputs = tokenizer(texts, padding=True, truncation=True, return_tensors="pt")
# Make predictions
with torch.no_grad():
logits = model(**inputs).logits
# Get the predicted sentiment labels
predictions = torch.argmax(logits, dim=-1)
labels = ["Negative", "Neutral", "Positive"] # Adjust based on your label mapping
for text, pred in zip(texts, predictions):
print(f"Text: {text} -> Sentiment: {labels[pred.item()]}")
Text: bu ürün çok iyi -> Sentiment: Positive
Text: bu ürün berbat -> Sentiment: Negative
To use this model, install the following dependencies:
pip install transformers
pip install torch
pip install datasets
winvoker/turkish-sentiment-analysis-dataset dataset.This model is licensed under the MIT License. See the LICENSE file for more details.
Base model
answerdotai/ModernBERT-large