ExtractedRelation

Models & Types · AiDotNet.RetrievalAugmentedGeneration.Graph.Construction

Represents a relation extracted from text between two entities.

For Beginners

After finding entities in text, the next step is finding relationships between them. For example, in “Einstein worked at Princeton University”:

  • SourceEntity: “Einstein” (PERSON)
  • TargetEntity: “Princeton University” (ORGANIZATION)
  • RelationType: “WORKED_AT”
  • Confidence: 0.85 (fairly confident based on the verb “worked at”)

Constructors

Constructor Summary
ExtractedRelation()

Properties

Property Summary
double Confidence { get; set; } Confidence score for this relation extraction (0.0 to 1.0).
string Description { get; set; } Optional natural-language description of the relation (populated by LLM extraction; empty for the regex/heuristic path).
string RelationType { get; set; } The relation type (e.g., WORKS_AT, BORN_IN, PART_OF).
string SourceEntity { get; set; } The source (subject) entity name.
string TargetEntity { get; set; } The target (object) entity name.