Model Card for XLM-RoBERTa Spanish Conflict Detection Classifier
A fine-tuned XLM-RoBERTa model for detecting social conflict mentions in Spanish news articles. The model is trained on the "Conflicto Social en Noticias" dataset and achieves 91.07% macro-F1 score on test data, making it suitable for automated content classification and conflict-related news filtering.
Model Details
Model Description
This is a binary text classification model based on FacebookAI/xlm-roberta-base fine-tuned to detect whether Spanish news articles discuss social conflict or not. The model was trained using a rigorous multi-seed approach (10 random seeds) to ensure robustness and generalization.
The classification task is binary:
CONFLICTO (1): News articles that discuss social conflict
NO_CONFLICTO (0): News articles that do not discuss social conflict
The model achieved strong performance across multiple evaluation runs, with consistent metrics indicating reliable predictions on unseen test data.
Model Details
Developed by: Germán Rosati (Factor~Data, SICSS-Buenos Aires)
Automated news classification: Identify news articles discussing social conflict in Spanish-language sources
Content moderation: Flag conflict-related content for review or categorization
News aggregation: Filter and organize news by conflict relevance
Research and analytics: Systematic analysis of conflict coverage in news media
Social media monitoring: Detect posts discussing social conflict
Downstream Use [optional]
This model can be integrated into:
News recommendation systems to provide conflict-focused news feeds
Content management systems for automated news categorization
Data pipelines for media analysis research
Misinformation detection systems (as a conflict-detection component)
Out-of-Scope Use
This model is not suitable for:
Languages other than Spanish (though XLM-RoBERTa is multilingual, the model was fine-tuned only on Spanish data)
Content moderation decisions without human review (should be used as a scoring/filtering tool, not final arbiter)
Real-time moderation of live content streams without performance testing in your specific domain
Classification of informal text, social media, or user-generated content not resembling news articles (model trained on news)
Bias, Risks, and Limitations
Limitations
Language: Model trained exclusively on Spanish news articles. Performance on other languages or dialects is unknown.
Domain: Model trained on news articles. Performance on other text types (social media, academic text, etc.) may be degraded.
Temporal bias: Dataset represents a specific time period. Linguistic evolution and emerging conflict narratives may not be captured.
Class balance: Dataset contains both conflict and non-conflict examples. Performance may vary based on class distribution in your specific use case.
Truncation: Text is truncated to 256 tokens (matching model's training setup). Very long articles may lose important context.
Context sensitivity: "Conflict" detection is based on textual patterns. Sarcasm, irony, or indirect references may be misclassified.
Risks and Biases
Labeling bias: Model inherits any biases present in the original dataset annotation process
Geographic bias: News sources and conflict types in training data may not represent all Spanish-speaking regions equally
Media bias: Model trained on news articles, which may have their own coverage biases
Potential overreach: Model might flag articles mentioning conflict in non-concerning contexts (e.g., historical analysis, conflict resolution discussion)
Recommendations
Always validate: Test the model on your specific data before production deployment
Human review: Use model predictions as a starting point for human review, not as final decisions
Monitor performance: Track model performance over time and across different domains
Document decisions: Keep clear records of how the model is being used and any adjustments made
Consider context: Combine model predictions with other signals for robust classification decisions
How to Get Started with the Model
Installation
pip install transformers torch
Quickstart - Using the Pipeline API
python
1from transformers import pipeline
23# Initialize the model4classifier = pipeline(5"text-classification",6 model="gefero/conflict_detection_ROBERTA_based"7)89# Classify text10texts =[11"El gobierno anunció nuevas políticas de seguridad social",12"Miles de personas protestaron en las calles contra las medidas económicas"13]1415results = classifier(texts)16for text, result inzip(texts, results):17print(f"Text: {text[:50]}...")18print(f"Label: {result['label']} (score: {result['score']:.4f})\n")
Max length: 256 tokens (increased from default 128 to capture longer articles)
Truncation: Long articles truncated to max_length
Padding: Padded to max_length for batch processing
Training Hyperparameters
Base model: FacebookAI/xlm-roberta-base
Learning rate: 2e-5
Batch size: 16 (training), 64 (evaluation)
Epochs: 5
Weight decay: 0.01
Warmup steps: 0.1 (proportion of total training steps)
Evaluation strategy: Evaluate at the end of each epoch
Best model selection: Based on macro-F1 on development set
Hardware: GPU with FP16 (mixed precision) when available
Random seeds: 10 seeds [0, 1, 7, 13, 42, 100, 123, 2024, 31337, 65535] for robust evaluation
Training Details
Framework: Hugging Face Transformers
Optimizer: AdamW (default)
Metric for best model: macro-F1 (average of precision and recall across both classes)
Multi-seed training: Model was trained 10 times with different random seeds to ensure robustness and to provide confidence intervals on performance metrics
Evaluation
Testing Data, Factors & Metrics
Testing Data
Split: Test set (20% of original data, stratified split)
Size: ~806 examples
Language: Spanish
Domain: News articles from the original dataset
Metrics
Macro-F1 (primary metric): Average F1-score across both classes
Used for model selection during training
Balances precision and recall
Better for imbalanced or binary classification tasks
Accuracy: Overall correctness of predictions
F1-CONFLICTO: F1-score specifically for the CONFLICTO class (conflict-related news)
GPU: NVIDIA GPU (exact model unspecified, but typical for Colab)
CPU: Supporting processors on Colab infrastructure
RAM: Standard Colab allocation
Training Time
Per seed: ~5-10 minutes (5 epochs per training run)
Total: ~50-100 minutes for 10 complete runs
Cloud Platform: Google Colaboratory (free tier)
Carbon Emissions
Estimated CO2 emissions for multi-seed training approach: Low to minimal (Colab's data centers use renewable energy sources). Individual training runs are short (~10 min each) and performed on highly optimized infrastructure.