Slovak Migration Stance
Collection
Expert-annotated stance dataset and fine-tuned model for Slovak migration discourse. Artifacts for the "Where We Stand" paper. • 2 items • Updated
This model categorizes the stance expressed in text regarding migration into three categories: Positive, Negative, or Neutral.
This model is fine-tuned to detect stance in migration-related content. It can identify whether a text expresses support for migration (positive), opposition to migration (negative), or presents factual/neutral information.
Key Features:
from transformers import AutoModelForSequenceClassification, AutoTokenizer
import torch
# Load model and tokenizer
model_name = "MIMEDIS/stance-model"
model = AutoModelForSequenceClassification.from_pretrained(model_name)
tokenizer = AutoTokenizer.from_pretrained(model_name)
# Prepare input
text = "Migrácia obohacuje našu spoločnosť o nové perspektívy a kultúry."
inputs = tokenizer(text, return_tensors="pt", padding=True, truncation=True, max_length=512)
# Get predictions
with torch.no_grad():
outputs = model(**inputs)
predictions = torch.nn.functional.softmax(outputs.logits, dim=-1)
predicted_class = torch.argmax(predictions, dim=-1).item()
# Map class to label
labels = {0: "NEGATIVE", 1: "NEUTRAL", 2: "POSITIVE"}
print(f"Text: {text}")
print(f"Predicted stance: {labels[predicted_class]}")
print(f"Confidence: {predictions[0][predicted_class]:.4f}")
print(f"All probabilities: NEGATIVE={predictions[0][0]:.4f}, NEUTRAL={predictions[0][1]:.4f}, POSITIVE={predictions[0][2]:.4f}")
Base model
gerulata/slovakbert