Skip to main content
Version: 0.0.5 (stable)

agrag.common.data_models.extraction.ExtractionResult

Bases: BaseModel

The entities and relations one Extractor call found in one Chunk.

Attributes:

  • entities (list[ExtractedEntity]) – The mentions found, in extraction order.
  • relations (list[ExtractedRelation]) – The relation mentions found, referencing entities by index.
  • extractor_name (str) – Which Extractor produced this result. Set by the Extractor itself. Useful for provenance when the pipeline mixes extractors.
  • candidates (list[CandidateRecord]) – Items the extractor found but did not keep, each with the reason. Empty when the extractor does not report discards or when candidates are turned off.
  • needs_properties (bool) – Whether a kept entity has a type that declares properties. An extractor that cannot fill property values sets it so that a stronger extractor can read the chunk again.
  • dropped (list[DroppedCount]) – Items removed without becoming candidate proposals.

candidates​

candidates: list[CandidateRecord] = Field(default_factory=list)

dropped​

dropped: list[DroppedCount] = Field(default_factory=list)

entities​

entities: list[ExtractedEntity]

extractor_name​

extractor_name: str

needs_properties​

needs_properties: bool = False

relations​

relations: list[ExtractedRelation]