ExtractedRelationship

A relationship extracted between two entities.

Usage

Source

ExtractedRelationship(
    source, target, relation="related_to", weight=1.0, metadata=dict()
)

Parameters

source: str

Name of the source entity.

target: str

Name of the target entity.

relation: str = "related_to"

The relationship label (e.g. "works_on", "mentioned_with").

weight: float = 1.0

Confidence or strength of the relationship (0.0–1.0).

metadata: dict[str, Any] = dict()
Extra context about the relationship.

Examples

import talk_box as tb

rel = tb.ExtractedRelationship(
    source="Sarah Chen",
    target="API Migration",
    relation="concerned_about",
)