Views
No views yet
dccuchile/bert-base-spanish-wwm-cased, adapted for the task of sensationalism detection in Spanish news articles.1from transformers import pipeline
2
3classifier = pipeline(
4 "text-classification",
5 model="JJNeila/bert-spanish-sensationalism-oss",
6 tokenizer="JJNeila/bert-spanish-sensationalism-oss"
7)
8
9classifier("Estados Unidos entrena a 25.000 militares (1.400 españoles) para defender el este de Europa")
10
11## Training Details
12
13### Training Data
14
15The model was trained on a curated dataset of Spanish news articles annotated for sensationalist presence.
16
17- **Size:** ~3,163 labeled samples
18- **Labels:**
19 - `0` → Non-sensationalism
20 - `1` → Sensationalism
21
22The input format used during training was:
23
24 *title* + *[SEP]* + *text*
25
26### Training Procedure
27
28#### Preprocessing
29
30- Removal of unlabeled samples
31- Concatenation of title and article text
32- Tokenization using the base BERT Spanish tokenizer
33- Maximum sequence length: **512 tokens**
34
35
36#### Training Hyperparameters
37
38- **Training regime:** fp16 mixed precision
39- **Optimizer:** AdamW
40- **Learning rate:** 2e-5
41- **Batch size:** 8
42- **Epochs:** 3
43- **Weight decay:** 0.01
44- **Evaluation metric for model selection:** F1
45
46#### Speeds, Sizes, Times
47- **Training time:** ~0,5 hours
48- **Hardware:** NVIDIA T4 GPU
49- **Final model size:** ~440 MB
50
51### Testing Data, Factors & Metrics
52
53#### Testing Data
54
55A held-out validation set (20%) stratified by class labels.
56
57#### Metrics
58
59The following metrics were used due to class imbalance considerations:
60
61- Accuracy
62- Precision
63- Recall
64- F1-score
65
66### Results
67
68| Metric | Value |
69|-----------|-------|
70| Accuracy | 0.84 |
71| Precision | 0.84 |
72| Recall | 0.83 |
73| F1-score | 0.84 |
74
75#### Summary
76
77The model achieves a strong balance between precision and recall, making it particularly effective at identifying sensationalism content without excessive false positives.
78
79---
80
81## Environmental Impact
82
83- **Hardware Type:** NVIDIA T4 GPU
84- **Hours used:** ~0,5 hours
85- **Cloud Provider:** Google Colab
86- **Compute Region:** Europe
87- **Carbon Emitted:** Not explicitly measured
88
89Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700).
90
91## Technical Specifications
92
93### Model Architecture and Objective
94
95- **Architecture:** BERT-base (12 layers, ~110M parameters)
96- **Objective:** Binary cross-entropy loss for text classification
97
98
99#### Hardware
100
101- NVIDIA T4 GPU (16 GB VRAM)
102
103#### Software
104
105- Python 3.12
106- PyTorch
107- Transformers
108- Hugging Face Datasets
109
110
111## Citation
112
113**BibTeX:**
114
115```bibtex
116@misc{neila2026sensationalism,
117 title={BERT Spanish Sensationalism Classifier},
118 author={Neila, Julen},
119 year={2026},
120 publisher={Hugging Face}
121}
122
123## Model Card Authors
124
125**Julen Neila**
126
127## Model Card Contact
128
129https://huggingface.co/JJNeila