Downloads · 30 days
48
8% of all-time downloads
NLP-Debater-Project/debertav3-stance-detection
debertav3-stance-detection is a text classification model from NLP-Debater-Project. Use it when you need a label for a piece of text. The card lists the license as mit.
This model detects whether an argument supports (PRO) or opposes (CON) a given topic.
Downloads · 30 days
48
8% of all-time downloads
All-time downloads
584
Public
Parameters
435M
1.7 GB on disk
Likes
2
Public
Click a slice to open those files.
.safetensors1.7 GB · 99%
From the Hugging Face model README
This model detects whether an argument supports (PRO) or opposes (CON) a given topic.
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch
# Load model
model_name = "yassine-mhirsi/debertav3-stance-detection"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForSequenceClassification.from_pretrained(model_name)
# Predict
topic = "AI should replace human teachers"
argument = "Teachers provide emotional support that AI cannot replicate"
text = f"Topic: {{topic}} [SEP] Argument: {{argument}}"
inputs = tokenizer(text, return_tensors="pt", truncation=True, max_length=512)
with torch.no_grad():
outputs = model(**inputs)
probs = torch.nn.functional.softmax(outputs.logits, dim=-1)
predicted_class = torch.argmax(probs, dim=-1).item()
stance = "PRO" if predicted_class == 1 else "CON"
confidence = probs[0][predicted_class].item()
print(f"Stance: {{stance}}")
print(f"Confidence: {{confidence:.2%}}")
If you use this model, please cite:
@misc{{stance-detection-deberta,
author = Yassine Mhirsi,
title = {{Stance Detection with DeBERTa-v3-large}},
year = {{2025}},
publisher = {{Hugging Face}},
howpublished = {{\\url{{https://huggingface.co/yassine-mhirsi/debertav3-stance-detection}}}}
}}