Instructions to use Flaglab/ESNLIR-AL-BERTIN-NegE with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Flaglab/ESNLIR-AL-BERTIN-NegE with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="Flaglab/ESNLIR-AL-BERTIN-NegE")# Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("Flaglab/ESNLIR-AL-BERTIN-NegE") model = AutoModelForSequenceClassification.from_pretrained("Flaglab/ESNLIR-AL-BERTIN-NegE", device_map="auto") - Notebooks
- Google Colab
- Kaggle
ESNLIR AL — Bertin-RoBERTa + NegE
Bertin-RoBERTa fine-tuned on ESNLIR through pool-based active learning with the NegE acquisition strategy. This is the best-performing round: 710,000 labels (71% of the 1M pool), selected over 7 of 10 acquisition rounds.
Active Learning for Spanish Natural Language Inference on a Heterogeneous Multi-Domain Corpus Diego Ortiz, Johan R. Portela, Ruben Manrique — Universidad de los Andes, Bogotá Advances in Artificial Intelligence — IBERAMIA 2026 (to appear)
Code: jd-rodriguezp1234/esnlir-active-learning
Results
On the 1,695-pair human-annotated test set:
| accuracy | macro F1 | contrasting | entailment | neutral | reasoning | |
|---|---|---|---|---|---|---|
| this model | 0.771 | 0.764 | 0.749 | 0.767 | 0.819 | 0.722 |
full supervision (Flaglab/ESNLIR-RoBERTa) |
— | 0.811 |
94.2% of full-supervision macro F1 using 71% of the labels. The gap to full supervision is never closed by any AL configuration in this study.
Classes are uneven in the test set (neutral 37.4%, contrasting 18.4%), so macro F1 is the
primary metric.
Strategy
Negative Energy (NegE) ranks the unlabeled pool by energy $-\log\sum_k \exp(z_k)$ and acquires the highest-scoring instances — those to which the model assigns no class a large logit. Unlike softmax entropy, energy is not distorted by probability normalization.
Both strategies perform indistinguishably (within 0.7 points of each other for a given encoder). Since LER acquires uniformly at random from a filtered pool, energy-based acquisition provides no measurable advantage over near-random selection — the paper's central negative result.
Labels
| id | label |
|---|---|
| 0 | contrasting |
| 1 | entailment |
| 2 | neutral |
| 3 | reasoning |
reasoning (cause–effect) is ESNLIR's departure from the usual three-class schema and is the
hardest class for every model here.
Usage
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch
name = "Flaglab/ESNLIR-AL-BERTIN-NegE"
tok = AutoTokenizer.from_pretrained(name)
model = AutoModelForSequenceClassification.from_pretrained(name)
inputs = tok("se pueden retener 10 pasaportes alemanes al mismo tiempo",
"estos pasaportes son válidos por solo 6 años",
return_tensors="pt", truncation=True, max_length=256)
with torch.no_grad():
logits = model(**inputs).logits
print(model.config.id2label[int(logits.argmax(-1))])
The bundled tokenizer is an unmodified copy of the one from
bertin-project/bertin-roberta-base-spanish; its vocabulary matches this model's embedding
table exactly.
Training
| base model | bertin-project/bertin-roberta-base-spanish |
| pool | Flaglab/ESNLIR-dataset train split |
| seed set | 10,000 (balanced) |
| acquisition size | 100,000 per round |
| rounds | 10 total; this checkpoint is round 6 |
| labels used | 710,000 |
| learning rate | 2e-5 |
| batch size | 32 |
| epochs per round | 3 |
| max sequence length | 256 |
| warm start | yes (model carried across rounds) |
| class weighting | balanced |
Full round-by-round metrics and the exact pool indices acquired at each step are published at
Flaglab/esnlir-al-trajectories.
Citation
@InProceedings{ortiz2026activelearningspanishnli,
author = {Ortiz, Diego and Portela, Johan R. and Manrique, Ruben},
title = {Active Learning for Spanish Natural Language Inference
on a Heterogeneous Multi-Domain Corpus},
booktitle = {Advances in Artificial Intelligence -- IBERAMIA 2026},
year = {2026},
publisher = {Springer Nature Switzerland},
address = {Cham},
note = {To appear},
}
The corpus is ESNLIR (Portela, Pérez-Terán & Manrique, 2026), a separate project with its own code and paper.
- Downloads last month
- -
Model tree for Flaglab/ESNLIR-AL-BERTIN-NegE
Base model
bertin-project/bertin-roberta-base-spanish