GLiNERRelationExtraction

Relation extraction task

Default predictor

This task uses GliNERPredictor by default.

GLiNERPredictor(
    GLiNERPredictorConfig(model_name="knowledgator/gliner-multitask-large-v0.5")
)

For more details, see:

GLiNERPredictor

By default, the predictor uses the knowledgator/gliner-multitask-large-v0.5 model. Learn more about the model here:

Subclass of Task.

Module: implementation.tasks

Methods and properties

Main methods and properties


__init__

Arguments:




GLiNERRelationExtractionPreprocessor

Create labels for relation extraction. Subclass of Action. Type of Action[Dict[str, Any], Dict[str, Any]].


execute

Arguments:

  • input_data (Dict[str, Any]): Expected keys:

Returns:

  • Dict[str, Any]: Expected keys:

    • "labels" (List[str]): Labels model inputs;




GLiNERRelationExtractionPostprocessor

Format output. Subclass of Action. Type of Action[Dict[str, Any], Dict[str, Any]].


execute

Arguments:

  • input_data (Dict[str, Any]): Expected keys:

    • "output" (List[List[Dict[str, Any]]]): Model output;

    • "relations" (List[Relation]): Relations parameters;

    • "entities" (List[ClassifiedEntity]): Entities to use;

    • "chunks_starts" (List[int]): Chunks starts;

Returns:

  • Dict[str, Any]: Expected keys:

    • "output" (List[Triplets]): Extracted relations;



Last updated