Update README.md
Browse files
README.md
CHANGED
@@ -1,37 +1,40 @@
|
|
1 |
---
|
2 |
library_name: transformers
|
3 |
-
tags:
|
|
|
|
|
|
|
|
|
|
|
4 |
---
|
5 |
|
6 |
-
# Model Card for
|
7 |
|
8 |
<!-- Provide a quick summary of what the model is/does. -->
|
|
|
9 |
|
10 |
-
|
11 |
|
12 |
## Model Details
|
13 |
|
14 |
### Model Description
|
15 |
|
16 |
<!-- Provide a longer summary of what this model is. -->
|
|
|
17 |
|
18 |
-
|
|
|
|
|
|
|
|
|
19 |
|
20 |
-
|
21 |
-
- **Funded by [optional]:** [More Information Needed]
|
22 |
-
- **Shared by [optional]:** [More Information Needed]
|
23 |
-
- **Model type:** [More Information Needed]
|
24 |
-
- **Language(s) (NLP):** [More Information Needed]
|
25 |
-
- **License:** [More Information Needed]
|
26 |
-
- **Finetuned from model [optional]:** [More Information Needed]
|
27 |
-
|
28 |
-
### Model Sources [optional]
|
29 |
|
30 |
<!-- Provide the basic links for the model. -->
|
|
|
|
|
31 |
|
32 |
-
|
33 |
-
- **Paper [optional]:** [More Information Needed]
|
34 |
-
- **Demo [optional]:** [More Information Needed]
|
35 |
|
36 |
## Uses
|
37 |
|
@@ -39,161 +42,94 @@ This is the model card of a 🤗 transformers model that has been pushed on the
|
|
39 |
|
40 |
### Direct Use
|
41 |
|
42 |
-
|
43 |
|
44 |
-
|
45 |
|
46 |
-
|
47 |
-
|
48 |
-
<!-- This section is for the model use when fine-tuned for a task, or when plugged into a larger ecosystem/app -->
|
49 |
-
|
50 |
-
[More Information Needed]
|
51 |
|
52 |
### Out-of-Scope Use
|
53 |
|
54 |
-
|
55 |
-
|
56 |
-
[More Information Needed]
|
57 |
|
58 |
-
|
59 |
-
|
60 |
-
<!-- This section is meant to convey both technical and sociotechnical limitations. -->
|
61 |
-
|
62 |
-
[More Information Needed]
|
63 |
|
64 |
-
###
|
65 |
|
66 |
-
|
|
|
67 |
|
68 |
-
Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
|
69 |
|
70 |
## How to Get Started with the Model
|
71 |
|
72 |
-
|
73 |
|
74 |
-
[More Information Needed]
|
75 |
|
76 |
-
|
|
|
|
|
77 |
|
78 |
-
|
79 |
|
80 |
-
|
|
|
81 |
|
82 |
-
|
|
|
|
|
83 |
|
84 |
-
|
|
|
|
|
|
|
85 |
|
86 |
-
|
|
|
|
|
87 |
|
88 |
-
|
|
|
|
|
|
|
89 |
|
90 |
-
[More Information Needed]
|
91 |
|
92 |
|
93 |
-
|
94 |
|
95 |
-
|
96 |
|
97 |
-
|
|
|
98 |
|
99 |
-
|
|
|
|
|
|
|
|
|
|
|
100 |
|
101 |
-
[More Information Needed]
|
102 |
|
103 |
## Evaluation
|
104 |
|
105 |
-
|
106 |
-
|
107 |
-
### Testing Data, Factors & Metrics
|
108 |
-
|
109 |
-
#### Testing Data
|
110 |
-
|
111 |
-
<!-- This should link to a Dataset Card if possible. -->
|
112 |
-
|
113 |
-
[More Information Needed]
|
114 |
-
|
115 |
-
#### Factors
|
116 |
-
|
117 |
-
<!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
|
118 |
-
|
119 |
-
[More Information Needed]
|
120 |
-
|
121 |
-
#### Metrics
|
122 |
-
|
123 |
-
<!-- These are the evaluation metrics being used, ideally with a description of why. -->
|
124 |
-
|
125 |
-
[More Information Needed]
|
126 |
-
|
127 |
-
### Results
|
128 |
-
|
129 |
-
[More Information Needed]
|
130 |
-
|
131 |
-
#### Summary
|
132 |
|
|
|
|
|
133 |
|
134 |
|
135 |
-
## Model Examination [optional]
|
136 |
|
137 |
-
<!-- Relevant interpretability work for the model goes here -->
|
138 |
-
|
139 |
-
[More Information Needed]
|
140 |
-
|
141 |
-
## Environmental Impact
|
142 |
-
|
143 |
-
<!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
|
144 |
-
|
145 |
-
Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700).
|
146 |
-
|
147 |
-
- **Hardware Type:** [More Information Needed]
|
148 |
-
- **Hours used:** [More Information Needed]
|
149 |
-
- **Cloud Provider:** [More Information Needed]
|
150 |
-
- **Compute Region:** [More Information Needed]
|
151 |
-
- **Carbon Emitted:** [More Information Needed]
|
152 |
-
|
153 |
-
## Technical Specifications [optional]
|
154 |
-
|
155 |
-
### Model Architecture and Objective
|
156 |
-
|
157 |
-
[More Information Needed]
|
158 |
-
|
159 |
-
### Compute Infrastructure
|
160 |
-
|
161 |
-
[More Information Needed]
|
162 |
-
|
163 |
-
#### Hardware
|
164 |
-
|
165 |
-
[More Information Needed]
|
166 |
-
|
167 |
-
#### Software
|
168 |
-
|
169 |
-
[More Information Needed]
|
170 |
|
171 |
## Citation [optional]
|
172 |
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
**APA:**
|
180 |
-
|
181 |
-
[More Information Needed]
|
182 |
-
|
183 |
-
## Glossary [optional]
|
184 |
-
|
185 |
-
<!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
|
186 |
-
|
187 |
-
[More Information Needed]
|
188 |
-
|
189 |
-
## More Information [optional]
|
190 |
-
|
191 |
-
[More Information Needed]
|
192 |
-
|
193 |
-
## Model Card Authors [optional]
|
194 |
-
|
195 |
-
[More Information Needed]
|
196 |
|
197 |
## Model Card Contact
|
198 |
|
199 |
-
|
|
|
|
1 |
---
|
2 |
library_name: transformers
|
3 |
+
tags:
|
4 |
+
- sentiment-analysis
|
5 |
+
- aspect-based-sentiment-analysis
|
6 |
+
- turkish
|
7 |
+
- transformers
|
8 |
+
- bert
|
9 |
---
|
10 |
|
11 |
+
# Model Card for ABSA_Turkish_BERT_Based_Small
|
12 |
|
13 |
<!-- Provide a quick summary of what the model is/does. -->
|
14 |
+
This model performs **Aspect-Based Sentiment Analysis (ABSA)** for Turkish text. It predicts sentiment polarity (Positive, Neutral, Negative) towards specific aspects within a given sentence.
|
15 |
|
16 |
+
---
|
17 |
|
18 |
## Model Details
|
19 |
|
20 |
### Model Description
|
21 |
|
22 |
<!-- Provide a longer summary of what this model is. -->
|
23 |
+
This model is fine-tuned from the `dbmdz/bert-base-turkish-cased` pretrained BERT model. It is trained on the **Turkish-ABSA-Wsynthetic.csv** dataset, which contains Turkish restaurant reviews annotated with aspect-based sentiments. The model is capable of identifying the sentiment polarity for specific aspects (e.g., "servis," "fiyatlar") mentioned in Turkish sentences.
|
24 |
|
25 |
+
- **Developed by:** Sengil
|
26 |
+
- **Language(s):** Turkish 🇹🇷
|
27 |
+
- **License:** Apache-2.0
|
28 |
+
- **Finetuned from model:** `dbmdz/bert-base-turkish-cased`
|
29 |
+
- **Number of Labels:** 3 (Negative, Neutral, Positive)
|
30 |
|
31 |
+
### Model Sources
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
32 |
|
33 |
<!-- Provide the basic links for the model. -->
|
34 |
+
- **Repository:** [ABSA_Turkish_BERT_Based_Small](https://huggingface.co/Sengil/ABSA_Turkish_BERT_Based_Small)
|
35 |
+
- **Dataset:** [Turkish-ABSA-Wsynthetic](https://github.com/sengil/turkish-absa-dataset)
|
36 |
|
37 |
+
---
|
|
|
|
|
38 |
|
39 |
## Uses
|
40 |
|
|
|
42 |
|
43 |
### Direct Use
|
44 |
|
45 |
+
This model can be used directly for analyzing aspect-specific sentiment in Turkish text, especially in domains like restaurant reviews.
|
46 |
|
47 |
+
### Downstream Use
|
48 |
|
49 |
+
It can be fine-tuned for similar tasks in different domains (e.g., e-commerce, hotel reviews, or customer feedback analysis).
|
|
|
|
|
|
|
|
|
50 |
|
51 |
### Out-of-Scope Use
|
52 |
|
53 |
+
- Not suitable for tasks unrelated to sentiment analysis or Turkish language.
|
54 |
+
- May not perform well on datasets with significantly different domain-specific vocabulary.
|
|
|
55 |
|
56 |
+
---
|
|
|
|
|
|
|
|
|
57 |
|
58 |
+
### Limitations
|
59 |
|
60 |
+
- May struggle with rare or ambiguous aspects not covered in the training data.
|
61 |
+
- May exhibit biases present in the training dataset.
|
62 |
|
|
|
63 |
|
64 |
## How to Get Started with the Model
|
65 |
|
66 |
+
<!-- This section provides code examples and links to further documentation. -->
|
67 |
|
|
|
68 |
|
69 |
+
```
|
70 |
+
!pip install -U transformers
|
71 |
+
```
|
72 |
|
73 |
+
Use the code below to get started with the model:
|
74 |
|
75 |
+
```python
|
76 |
+
from transformers import AutoTokenizer, AutoModelForSequenceClassification
|
77 |
|
78 |
+
# Load the model and tokenizer
|
79 |
+
model = AutoModelForSequenceClassification.from_pretrained("Sengil/ABSA_Turkish_BERT_Based_Small")
|
80 |
+
tokenizer = AutoTokenizer.from_pretrained("Sengil/ABSA_Turkish_BERT_Based_Small")
|
81 |
|
82 |
+
# Example inference
|
83 |
+
text = "Servis çok yavaştı ama yemekler lezzetliydi."
|
84 |
+
aspect = "servis"
|
85 |
+
formatted_text = f"[CLS] {text} [SEP] {aspect} [SEP]"
|
86 |
|
87 |
+
inputs = tokenizer(formatted_text, return_tensors="pt", padding="max_length", truncation=True, max_length=128)
|
88 |
+
outputs = model(**inputs)
|
89 |
+
predicted_class = outputs.logits.argmax(dim=1).item()
|
90 |
|
91 |
+
# Map prediction to label
|
92 |
+
labels = {0: "Negative", 1: "Neutral", 2: "Positive"}
|
93 |
+
print(f"Sentiment for '{aspect}': {labels[predicted_class]}")
|
94 |
+
```
|
95 |
|
|
|
96 |
|
97 |
|
98 |
+
## Training Details
|
99 |
|
100 |
+
### Training Data
|
101 |
|
102 |
+
Training Data
|
103 |
+
The model was fine-tuned on the Turkish-ABSA-Wsynthetic.csv dataset. The dataset contains semi-synthetic Turkish sentences annotated for aspect-based sentiment analysis.
|
104 |
|
105 |
+
- Training Procedure
|
106 |
+
- Optimizer: AdamW
|
107 |
+
- Learning Rate: 2e-5
|
108 |
+
- Batch Size: 16
|
109 |
+
- Epochs: 5
|
110 |
+
- Max Sequence Length: 128
|
111 |
|
|
|
112 |
|
113 |
## Evaluation
|
114 |
|
115 |
+
The model achieved the following scores on the test set:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
116 |
|
117 |
+
- Accuracy: 95.48%
|
118 |
+
- F1 Score (Weighted): 95.46%
|
119 |
|
120 |
|
|
|
121 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
122 |
|
123 |
## Citation [optional]
|
124 |
|
125 |
+
@misc{absa_turkish_bert_based_small,
|
126 |
+
title={Aspect-Based Sentiment Analysis for Turkish},
|
127 |
+
author={Sengil},
|
128 |
+
year={2024},
|
129 |
+
url={https://huggingface.co/Sengil/ABSA_Turkish_BERT_Based_Small}
|
130 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
131 |
|
132 |
## Model Card Contact
|
133 |
|
134 |
+
For any questions or issues, please open an issue in the repository or contact [LinkedIN](https://www.linkedin.com/in/mertsengil/).
|
135 |
+
|