Downloads · 30 days
9
6% of all-time downloads
byunal/convbert-base-turkish-cased-stance
convbert-base-turkish-cased-stance is a text classification model from byunal. Use it when you need a label for a piece of text. The card lists the license as apache-2.0.
Downloads · 30 days
9
6% of all-time downloads
All-time downloads
147
Public
Parameters
107M
430 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors430 MB · 100%
From the Hugging Face model README
This repository contains a fine-tuned BERT model for stance detection in Turkish. The base model for this fine-tuning is dbmdz/convbert-base-turkish-cased. The model has been specifically trained on a uniquely collected Turkish stance detection dataset.
The model predicts the stance of a given text towards a specific target. Possible stance labels include:
To install the necessary libraries and load the model, run:
pip install transformers
Here’s a simple example of how to use the model for stance detection in Turkish:
from transformers import AutoModelForSequenceClassification, AutoTokenizer
import torch
# Load the model and tokenizer
model_name = "byunal/convbert-base-turkish-cased-stance"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForSequenceClassification.from_pretrained(model_name)
# Example text
text = "Bu konu hakkında kesinlikle karşıyım."
# Tokenize input
inputs = tokenizer(text, return_tensors="pt", truncation=True, padding=True)
# Perform prediction
with torch.no_grad():
outputs = model(**inputs)
# Get predicted stance
predictions = torch.argmax(outputs.logits, dim=-1)
stance_label = predictions.item()
# Display result
labels = ["Favor", "Against", "Neutral"]
print(f"The stance is: {labels[stance_label]}")
This model was fine-tuned using a specialized Turkish stance detection dataset that uniquely reflects various text contexts and opinions. The dataset includes diverse examples from social media, news articles, and public comments, ensuring a robust understanding of stance detection in real-world applications.
The model was evaluated using Accuracy and Macro F1-score on a validation dataset. The results confirm the model's effectiveness in stance detection tasks in Turkish.