Relation extraction tasks utilities
RelationExtractionInput
Subclass of IOModel.
__init__
Arguments:
text (str): Text to process.
relations (List[Relation]): Relations parameters.
entities (List[ClassifiedEntity]): Entities to use.
RelationExtractionOutput
Subclass of IOModel.
__init__
Arguments:
output (List[Triplet]): Relations triplets.
Relation
__init__
Arguments:
relation (str): Relation label.
pairs_filter (Optional[List[Tuple[str, str]]], optional): Expected pairs for relation. If equals to None all pairs will be returned. Defaults to None.
distance_threshold (int, optional): Distance threshold. It specifies the max distance between spans in the text (i.e., the end of the span that is closer to the start of the text and the start of the next one). Defaults to -1 (no distance threshold).
Triplet
__init__
Arguments:
source (ClassifiedEntity): Source entity in the relation.
relation (str): Relation label.
target (ClassifiedEntity): Target entity in the relation.
score (float): Relation score.
Last updated