Onarex

Onarex is an ontology-conditioned information extraction model with exclusive NER / REL / EMB trunks and phased training (rel_only β†’ ner_only β†’ emb_only).

This Hub repo contains a trained checkpoint exported via OnarexModel.save_pretrained (config.yaml + pytorch_model.bin).

Model summary

Field Value
Encoder answerdotai/ModernBERT-large
Hidden size 1024
BiLSTM True
Checkpoint phase emb_only
Selection metric triple_emb_cosine = 0.957874 (step 120000)

Architecture (high level)

  • Shared ModernBERT encoder (+ optional BiLSTM)
  • Exclusive trunks: separate span/pair modules for NER, REL, and triple embedding
  • Ontology-conditioned NER / REL scoring (typed label inventory at train/infer)
  • Phased training: relation path first (encoder FT), then NER, then emb alignment
  • Train is GT-fed for REL/EMB; inference uses the NER β†’ REL β†’ emb cascade

Files

  • config.yaml β€” model / training / eval hyperparameters
  • pytorch_model.bin β€” full state_dict
  • best.json β€” optional metadata for the best validation checkpoint
  • README.md β€” this model card

Loading

A public onarex Python package is not published yet. With the research repo installed:

from onarex.model import OnarexModel

model = OnarexModel.from_pretrained("cb-ai/onarex")
# or from a local download of this folder
# model = OnarexModel.from_pretrained("./onarex_model_emb_only_best")

Inference helpers live in the Onarex repository (inference.py); they are not bundled as a standalone Hub pipeline here.

Intended use

  • Ontology-conditioned NER + relation extraction
  • Research / experimentation on typed IE and triple embedding alignment

Limitations

  • English-focused training data
  • Requires an ontology / label inventory (entity types + relation inventory) at inference
  • Cascade errors: NER mistakes propagate to REL/EMB
  • Not a drop-in Hub pipeline without the Onarex codebase

Training notes

Phased exclusive-path training:

  1. rel_only β€” REL trunk (+ encoder / BiLSTM when enabled)
  2. ner_only β€” NER trunk (encoder frozen)
  3. emb_only β€” emb trunk (encoder frozen); this upload is typically the final emb best ckpt

Teacher triple embeddings used during emb_only are ModernBERT-pooled description vectors (see training config data.* paths).

Citation

If you use this checkpoint, please cite the related GLiREL / ModernBERT lines of work as appropriate for your paper, and credit the Onarex project.

@misc{onarex2026,
  title={Onarex: Ontology-conditioned NER, Relation Extraction, and Triple Embedding},
  year={2026},
  howpublished={Hugging Face model card: cb-ai/onarex},
}

Model card contact

Uploaded from an Onarex exclusive-path training run. Replace this section with your org / author contact as needed.

Downloads last month
7
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support