加载中…
加载中…
Classifies a Peruvian news headline (in Spanish) into one of 4 categories.
Academic project by Rodrigo Norabuena for Assignment 1 of the Intermediate Python course, part of the Diplomatura de especialización Ciencia de Datos para las Ciencias Sociales y la Gestión Pública 2026.
Code, data and notebooks: https://github.com/rodnm/intermediate-python-hw/tree/main/tarea_1
| Label | Meaning |
|---|---|
politica |
Politics |
economia |
Economy |
deportes |
Sports |
ciencia_tecnologia |
Science and technology |
from transformers import pipeline
classifier = pipeline("text-classification", model="rodnm/distilbert-noticias-peru", top_k=None)
classifier("BCR mantiene su tasa de referencia en 4,25 %")
max_length=64.learning_rate=5e-5, weight_decay=0.01, seed 42.| Approach | Macro F1 |
|---|---|
| This model (fine-tuned on the editorial labels) | 0.908 |
LLM gemini-3.8-flash with headline and subheadline |
0.909 |
Zero-shot Recognai/bert-base-spanish-wwm-cased-xnli (40 test headlines) |
0.640 |
Accuracy: 0.91. Macro F1 by outlet: 0.968 for La República and 0.849 for El Comercio.
deportes (0.74). Without
"por tercer mes consecutivo", it is predicted as economia (0.88).