Skip to main content
Version: latest

agrag.common.data_models.extraction.ExtractedRelation

Bases: BaseModel

One relation mention between two ExtractedEntity mentions in one Chunk.

Attributes:

  • chunk_id (UUID) – The id of the Chunk this mention came from.
  • label (str) – The RelationType label this mention was extracted as.
  • source_index (int) – Index of the source entity in the same ExtractionResult.entities.
  • target_index (int) – Index of the target entity in the same ExtractionResult.entities.
  • confidence (float | None) – The extractor's confidence in this mention, when available.
  • extractors (list[str]) – The names of the extractors that found this mention, such as gliner or llm. Empty when no extractor is named.

chunk_id​

chunk_id: UUID

confidence​

confidence: float | None = None

extractors​

extractors: list[str] = Field(default_factory=list)

label​

label: str

source_index​

source_index: int

target_index​

target_index: int