agrag.ingestion.extract.GlinerExtractor
GlinerExtractor(*, model_name:str = 'fastino/gliner2.5-small-v1', model:object | None = None, tracer:Tracer | None = None) -> None
Bases: Extractor
Extracts entities and relations with a local GLiNER2.5 model.
The model runs in this process, so extraction needs no LLM key. It loads on
first use and one load serves concurrent calls. The first load downloads the
weights from Hugging Face unless model is passed. GLiNER reports entity
spans and types, so extracted entities carry no property values. Needs the
extract extra.
Parameters:
- model_name (
str) – Checkpoint to load whenmodelis not provided. - model (
object | None) – An already-built GLiNER2.5 model. - tracer (
Tracer | None) – Opensagrag.extraction.glinerandagrag.extraction.model_loadspans.Noneopens no recorded span.
Functions:
- extract – Extract with the local GLiNER2.5 model.
Attributes:
extract
extract(chunk:Chunk, schema:GraphSchema) -> ExtractionResult
Extract with the local GLiNER2.5 model.
Parameters:
- chunk (
Chunk) – The chunk to read. Onlychunk.textandchunk.idare used. - schema (
GraphSchema) – The entity and relation types to extract.
Returns:
ExtractionResult– The normalized entities and relations found in the chunk.
Raises:
ExtractorMissingExtraError– Theextractpackage extra is not installed.ValueError–chunk.idisNone.
model_name
model_name = model_name