Downloads · 30 days
19
41% of all-time downloads
uvegesistvan/EDG-xlm-roberta-large
EDG-xlm-roberta-large is a text classification model from uvegesistvan. Use it when you need a label for a piece of text. It is set up for transformers. The card lists the license as apache-2.0.
This model is based on XLM-RoBERTa-large and has been fine-tuned on English, Hungarian, and German data for text classification of European Parliamentary speeches into rhetorical categories.
Downloads · 30 days
19
41% of all-time downloads
All-time downloads
46
Public
Parameters
560M
13.5 GB on disk
Likes
0
Public
Click a slice to open those files.
.pt9 GB · 57%
From the Hugging Face model README
This model is based on XLM-RoBERTa-large and has been fine-tuned on English, Hungarian, and German data for text classification of European Parliamentary speeches into rhetorical categories.
The model classifies text into three categories:
This model is useful for analyzing political discourse and rhetorical styles in multiple languages.
The model was evaluated on a test set of 938 sentences, with the following results:
| Label | Precision | Recall | F1-score | Support |
|---|---|---|---|---|
| 0 - Other | 0.98 | 0.95 | 0.96 | 783 |
| 1 - Moralist | 0.73 | 0.82 | 0.77 | 65 |
| 2 - Realist | 0.79 | 0.90 | 0.84 | 90 |
The model reliably distinguishes rhetorical styles, with strong performance across all categories.
Below is the confusion matrix for the model's performance on the test set:
This model can be used with the Hugging Face Transformers library:
from transformers import AutoTokenizer, AutoModelForSequenceClassification
model_name = "uvegesistvan/EDG-xlm-roberta-large"
# Load tokenizer and model
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForSequenceClassification.from_pretrained(model_name)
# Classify an example text
text = "The European Union has a responsibility towards future generations."
inputs = tokenizer(text, return_tensors="pt")
outputs = model(**inputs)
logits = outputs.logits
# Get predicted class
predicted_class = logits.argmax().item()
print(f"Predicted class: {predicted_class}")