Downloads · 30 days
0
ottema/gliner2-ptbr-ontoevidence
gliner2-ptbr-ontoevidence is a token classification model from ottema. Use it when you need labels on individual words, such as names. It is set up for gliner. The card lists the license as apache-2.0.
Ontology-guided evidence extraction for Brazilian Portuguese operational text (education, technical support, assistance) with hard-negative rejection.
Downloads · 30 days
0
Access
Public
Updated Jun 20, 2026
Parameters
307M
1.2 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors1.2 GB · 98%
From the Hugging Face model README
Ontology-guided evidence extraction for Brazilian Portuguese operational text (education, technical support, assistance) with hard-negative rejection.
This is the first version with real weights, trained using an anti-yes-man recipe that combines OE positives with diverse HAREM-style samples to prevent the model from collapsing into predicting all labels.
Evaluation on the OntoEvidence-BR test set (114 samples, 302 entities, full 58-label ontology, threshold 0.3):
| Model | OE samples | Mix (OE/HAREM/anti) | Avg pred/text | Precision | Recall | F1 | Yes-man? |
|---|---|---|---|---|---|---|---|
| v0.18 (this model) | 2041 | 31% / 63% / 6% | 4.41 | 0.256 | 0.427 | 0.320 | No ✅ |
| v0.17 | 2041 | 45% / 45% / 10% | 4.27 | 0.253 | 0.407 | 0.312 | No ✅ |
| v0.19 (5x OE data) | 3876 | 37% / 56% / 7% | 15.12 | 0.102 | 0.583 | 0.174 | Yes 🔴 |
| v0.20 (3x vol, 31%) | 3876 | 31% / 63% / 6% | 14.51 | 0.105 | 0.576 | 0.178 | Yes 🔴 |
| v0.16 (OE 70%, no HAREM) | 2041 | 70% / 30% / 0% | 17.96 | 0.091 | 0.616 | 0.158 | Yes 🔴 |
Data scaling findings:
A healthy model predicts 1-3 entities per text on average. The v0.18 model sits in this range, confirming the yes-man failure mode is broken.
Text: "a marcha n esta funcionando"
cambio_signal 0.83 ✅ (correct: gearbox issue)pane_mecanica_signal 0.32 (correct: mechanical failure)motor_signal 0.91 ⚠️ (over-predicted, but thresh=0.3 keeps it)Text: "o motor falhou"
motor 0.998 ✅pane_mecanica_signal 0.61 ✅cambio_signal 0.73 ⚠️ (motor ≠ gearbox, but model is uncertain)Text: "tô com febre"
febre 1.000 ✅condicao_medica 1.000 ✅servico_saude 0.59 (borderline)The model gets the right entities with high confidence but has residual label confusion (predicting multiple plausible labels for the same span). This is the next challenge to address in v0.19+.
Operational text in Brazilian Portuguese — atendimento, suporte técnico, educação — is noisy, domain-specific, and full of hard negatives (everyday words that look like entities but aren't):
| Text | Surface form | Why it's a hard negative |
|---|---|---|
| "dê um passo pra frente" | "frente" | Not a "front" entity; it's a movement direction |
| "o motor falhou" | "motor" | Not a "car part" entity; it's a generic device |
| "a marcha foi longa" | "marcha" | Could be "gear" (auto), "march" (protest), or "stride" (walking) |
| "tô com febre" | "febre" | Medical symptom, not a "condition code" |
Standard NER models trained on HAREM (journalistic) collapse on operational text because they learned to predict "local" for any capitalized word, "pessoa" for any first name, etc. OntoEvidence-BR trains models to discriminate between entity and non-entity in noisy domains.
Earlier attempts to fine-tune GLiNER2 on OntoEvidence-BR caused a structural failure mode we call "yes-man" — the model learns to predict ALL ontology labels with confidence 1.0, regardless of input. We tried:
What worked:
The HAREM-style mix teaches the model that most real text has few or no OE entities, breaking the "predict everything" bias.
from gliner2 import GLiNER2
model = GLiNER2.from_pretrained("ottema/gliner2-ptbr-ontoevidence")
text = "a marcha do carro n esta funcionando"
labels = [
"marcha", "motor", "cambio_signal", "pane_mecanica_signal",
"motor_signal", "pane_eletrica_signal",
]
entities = model.extract_entities(text, labels, threshold=0.3, include_confidence=True)
for label, spans in entities["entities"].items():
for span_info in spans:
if isinstance(span_info, dict):
print(f"{label}: '{span_info['text']}' ({span_info['confidence']:.3f})")
Recommended threshold: 0.3 for high recall, 0.5+ for high precision.
ottema/gliner2-ptbr-demo — interactive Gradio demo. Select the HAREM-specialized model and the OntoEvidence label presets to test hard-negative discrimination. For production use, this v0.18 model is preferred.
The model is functional but not great. Known limitations:
Planned improvements:
ottema/gliner2-ptbr-harem (HAREM-specialized)fastino/gliner2-multi-v1 (Fastino)ottema/gliner2-ptbr-haremApache-2.0