NLP-Debater-Project/IBM-Debater-ArgKP
Viewer • Updated • 81.6k • 166
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}}}}
}}
Base model
microsoft/deberta-v3-large