jaroslav-kopcan commited on
Commit
f211d39
·
verified ·
1 Parent(s): 2158454

Create README.md

Browse files

# Migration Stance Classification Model

This model categorizes the stance expressed in text regarding migration into three categories: **Positive**, **Negative**, or **Neutral**.

## Model Description

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:**
- **3-class classification**: POSITIVE, NEGATIVE, NEUTRAL
- **Domain-specific**: Optimized for migration and immigration discourse in Slovakia

## Labels

- **0 - NEGATIVE**: Text expressing opposition, concerns, or negative views about migration
- **1 - NEUTRAL**: Factual statements, balanced reporting, or no clear stance
- **2 - POSITIVE**: Text expressing support, benefits, or positive views about migration

## Usage

### Basic Usage
```python
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}")

Files changed (1) hide show
  1. README.md +15 -0
README.md ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ datasets:
4
+ - MIMEDIS/migration-stance-content
5
+ language:
6
+ - sk
7
+ base_model:
8
+ - gerulata/slovakbert
9
+ pipeline_tag: text-classification
10
+ tags:
11
+ - stance-classification
12
+ - text-classification
13
+ - slovakbert
14
+ - slovak
15
+ ---