Skip to main content
Version: 0.0.4

agrag.ingestion.extract.Extractor

Bases: ABC

Reads one Chunk and produces the entities and relations it contains.

Functions:

  • extract – Extract entities and relations from one chunk.

extract​

extract(chunk:Chunk, schema:GraphSchema) -> ExtractionResult

Extract entities and relations from one chunk.

Parameters:

  • chunk (Chunk) – The chunk to read. Only chunk.text and chunk.id are used.
  • schema (GraphSchema) – The entity/relation types to extract. Every returned entity's label and relation's label must be declared in this schema.

Returns:

  • ExtractionResult – The entities and relations this call found, in extraction order.