debertav3-stance-detection
23
1
license:mit
by
NLP-Debater-Project
Other
OTHER
New
23 downloads
Early-stage
Edge AI:
Mobile
Laptop
Server
Unknown
Mobile
Laptop
Server
Quick Summary
AI model with specialized capabilities.
Code Examples
Performancepythontransformers
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%}}")Deploy This Model
Production-ready deployment in minutes
Together.ai
Instant API access to this model
Production-ready inference API. Start free, scale to millions.
Try Free APIReplicate
One-click model deployment
Run models in the cloud with simple API. No DevOps required.
Deploy NowDisclosure: We may earn a commission from these partners. This helps keep LLMYourWay free.