Downloads · 30 days
9
13% of all-time downloads
Politics/hungary-mszp-dk-villain
hungary-mszp-dk-villain is a text classification model from Politics. Use it when you need a label for a piece of text. It is set up for transformers. The card lists the license as cc-by-nc-4.0.
This model is a fine-tuned version of SZTAKI-HLT/hubert-base-cc designed to detect "Villain" rhetoric targeting specific opposition parties (MSZP & DK) in Hungarian political media.
Downloads · 30 days
9
13% of all-time downloads
All-time downloads
69
Public
Parameters
111M
1.3 GB on disk
Likes
0
Public
Click a slice to open those files.
.pt885 MB · 67%
From the Hugging Face model README
This model is a fine-tuned version of SZTAKI-HLT/hubert-base-cc designed to detect "Villain" rhetoric targeting specific opposition parties (MSZP & DK) in Hungarian political media.
SZTAKI-HLT/hubert-base-ccThe model was trained to identify "Villain" rhetoric based on a codebook containing two primary components: Illegitimacy and Immorality.
1. Illegitimacy Component Sentences that portray MSZP/DK as illegitimate political actors, specifically containing claims that:
2. Immorality Component Sentences that portray MSZP/DK as immoral actors, specifically containing claims of:
The training dataset consists of a stratified sample of online news articles published between 2010 and 2024.
The model was trained using the transformers Trainer with the following hyperparameters:
Evaluation was performed on a held-out ground truth dataset (Politics/hungary-mszp-dk-heldout) consisting of human-labeled sentences that were not seen by the Teacher GPT model or the Student BERT model during training.
Performance of Checkpoint 3708 (9th Checkpoint):
| Metric | Score | Note |
|---|---|---|
| Accuracy | 90.1% | Overall correct classification rate. |
| Positive Precision | 81.5% | When model predicts "Villain", it is correct 81.5% of the time. |
| Positive Recall | 68.3% | The model catches 68.3% of all actual "Villain" sentences. |
| Positive F1 | 74.3% | Harmonic mean of precision and recall for the target class. |
| Negative F1 | 93.9% | Performance on the non-villain class. |
Note: This checkpoint was selected for its high precision (81.5%), minimizing false positives, which is crucial for automated content analysis in social science research.
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch
model_name = "Politics/hungary-mszp-dk-villain/"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForSequenceClassification.from_pretrained(model_name)
text = "A dollárbaloldal ismét elárulta a hazát Brüsszelben."
inputs = tokenizer(text, return_tensors="pt", truncation=True, max_length=512)
with torch.no_grad():
logits = model(**inputs).logits
predicted_class_id = logits.argmax().item()
print(f"Prediction: {predicted_class_id}")
# Output: 1 (Villain) or 0 (Neutral)
Domain Specificity: This model is trained on specific Hungarian political news contexts (2010-2024) regarding specific parties (MSZP/DK) and may not generalize well to other parties or domains.
Error Propagation: The training data utilizes "silver" labels generated by a fine-tuned GPT-4o. While the GPT-4o teacher was trained on human data, this model is essentially learning to approximate the teacher model's application of the codebook. Errors or biases present in the teacher model's predictions will be propagated to this BERT model.
Human labeling from English translations: While both the finetuned GPT-4o and the hubert models rely on labeled sentences in Hungarian (and expect new sentences in Hungarian), the human labeling was done through the English translations for both the ground-truth (heldout) and also the GPT-4o finetune set.
I am deeply grateful to the University of Chicago Forum for Free Inquiry and Expression for their generous funding of this research.