File size: 3,151 Bytes
81324af
 
2351421
 
 
 
 
 
 
81324af
 
2351421
81324af
2351421
 
81324af
2351421
81324af
2351421
81324af
 
2351421
 
 
 
 
 
 
81324af
2351421
 
81324af
2351421
81324af
2351421
 
8c2ef04
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
81324af
 
 
 
 
2351421
81324af
 
 
 
2351421
81324af
 
 
 
2351421
 
 
 
 
 
 
 
 
 
81324af
 
 
2351421
81324af
2351421
81324af
 
 
2351421
81324af
a94dc1d
 
 
 
 
81324af
 
 
 
2351421
81324af
2351421
 
 
 
81324af
 
 
 
 
2351421
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
---
library_name: transformers
tags:
- sentiment-analysis
- text-classification
- turkish
license: mit
base_model:
- FacebookAI/xlm-roberta-base
---

# πŸ† TurkReviewSentiment-RoBERTa: Sentiment Analysis Model for Turkish Texts

πŸ“’ **A fine-tuned XLM-RoBERTa model for sentiment analysis in Turkish texts!**  
This model can classify user reviews and texts as **positive** or **negative** sentiment.

---

## πŸ” **Model Details**

### Model Description
βœ… **Base Model:** XLM-RoBERTa  
βœ… **Finetuned from:** `xlm-roberta-base`  
βœ… **Training Data:** User reviews from e-commerce platforms  
βœ… **Task:** Sentiment Analysis (Binary Classification: Positive / Negative)  
βœ… **Language:** Turkish  
βœ… **Use Cases:** Customer feedback analysis, social media monitoring, market research  
βœ… **License:** MIT  

### Model Sources
- **Repository:** [Hugging Face Model Page](https://huggingface.co/fundaylnci/TurkReviewSentiment-RoBERTa)

---

## πŸ“Œ **How to Use the Model**
```python
import torch
from transformers import AutoModelForSequenceClassification, AutoTokenizer

def load_model(model_path):
    model = AutoModelForSequenceClassification.from_pretrained(model_path)
    tokenizer = AutoTokenizer.from_pretrained(model_path)
    return model, tokenizer

def get_sentiment(text, model, tokenizer):
    inputs = tokenizer(text, return_tensors="pt", truncation=True, padding=True, max_length=512)
    device = next(model.parameters()).device
    inputs = {k: v.to(device) for k, v in inputs.items()}
    outputs = model(**inputs)
    logits = outputs.logits
    predicted_class = torch.argmax(logits, dim=1).item()
    return "positive" if predicted_class == 1 else "negative"

    
model_path = "fundaylnci/TurkReviewSentiment-RoBERTa"
model, tokenizer = load_model(model_path)

text ="Bu ΓΌrΓΌn harika!"
get_sentiment(text,model, tokenizer)

## Training Details

### Training Data

Dataset: E-commerce product reviews + manually labeled sentiment data


#### Preprocessing [optional]

Tokenization with xlm-roberta-base tokenizer


#### Training Hyperparameters

        training_args = TrainingArguments(
            output_dir="./results",
            evaluation_strategy="epoch",
            learning_rate=learning_rate,
            per_device_train_batch_size=batch_size,
            num_train_epochs=3,
            weight_decay=0.01,
            logging_dir="./logs",
            logging_steps=10,
        )

#### Speeds, Sizes, Times [optional]

Checkpoint Size: ~500MB

Training Time: ~6 hours on NVIDIA T4 GPU

## Evaluation

Evaluation Metrics: Accuracy, F1-score

# Version 149608e489c0979a661489d53245a30a48d3d38e
Accuracy: 0.961
Precision: 0.977
Recall: 0.980
F1 Score: 0.979


## Environmental Impact

Carbon emissions can be estimated using the Machine Learning Impact calculator.

Hardware: NVIDIA T4 GPU
Training Hours: ~6 hours
Cloud Provider: Google Cloud
Estimated CO2 Emitted: ~3.2 kg

## Citation [optional]

**BibTeX:**

@article{turkreviewsentiment2025,
  title={TurkReviewSentiment-RoBERTa: Sentiment Analysis for Turkish Reviews},
  author={Your Name},
  journal={Hugging Face Model Hub},
  year={2025}
}