Downloads · 30 days
11
6% of all-time downloads
Sengil/ABSA-Turkish-bert-based-uncased
ABSA-Turkish-bert-based-uncased is a text classification model from Sengil. Use it when you need a label for a piece of text. It is set up for transformers.
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.
Downloads · 30 days
11
6% of all-time downloads
All-time downloads
171
Public
Parameters
111M
443 MB on disk
Likes
2
Public
Click a slice to open those files.
.safetensors443 MB · 100%
From the Hugging Face model README
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.
This model is fine-tuned from the dbmdz/bert-base-turkish-uncased pretrained BERT model. It is trained on the Turkish-ABSA-Wsynthetic 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.
dbmdz/bert-base-turkish-uncasedThis model can be used directly for analyzing aspect-specific sentiment in Turkish text, especially in domains like restaurant reviews.
It can be fine-tuned for similar tasks in different domains (e.g., e-commerce, hotel reviews, or customer feedback analysis).
!pip install -U transformers
Use the code below to get started with the model:
from transformers import AutoTokenizer, AutoModelForSequenceClassification
# Load the model and tokenizer
tokenizer = AutoTokenizer.from_pretrained("Sengil/ABSA-Turkish-bert-based-uncased")
model = AutoModelForSequenceClassification.from_pretrained("Sengil/ABSA-Turkish-bert-based-uncased")
# Example inference
text = "Servis çok yavaştı ama yemekler lezzetliydi."
aspect = "servis"
formatted_text = f"[CLS] {text} [SEP] {aspect} [SEP]"
inputs = tokenizer(formatted_text, return_tensors="pt", padding="max_length", truncation=True, max_length=128)
outputs = model(**inputs)
predicted_class = outputs.logits.argmax(dim=1).item()
# Map prediction to label
labels = {0: "Negative", 1: "Neutral", 2: "Positive"}
print(f"Sentiment for '{aspect}': {labels[predicted_class]}")
Training Data 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.
The model achieved the following scores on the test set:
@misc{absa_turkish_bert_based_uncased,
title={Aspect-Based Sentiment Analysis for Turkish},
author={Sengil},
year={2024},
url={https://huggingface.co/Sengil/ABSA_Turkish_BERT_Based_uncased}
}
For any questions or issues, please open an issue in the repository or contact LinkedIN.