TransformersTextSummarization

Text summarization task

Subclass of Task.

Module: implementation.tasks

Default predictor

This task uses TransformersModel by default with this configuration:

TransformersPipeline(
    TransformersPipelineConfig(
        task="summarization", 
        model="facebook/bart-large-cnn",
    ),
    input_class=SummarizationInput,
    output_class=TransformersBasicOutput
)

See:

Methods and properties

Main methods and properties


__init__

Arguments:

  • predictor (Predictor[Any, Any], optional): Predictor that will be used in task. If equals to None, default predictor will be used. Defaults to None.

  • preprocess (Optional[Component], optional): Component executed before predictor. Defaults to None.

  • postprocess (Optional[Component], optional): Component executed after predictor. If equals to None, default component will be used. Defaults to None. Default component: SummarizationPostprocess

  • input_class (Type[Input], optional): Class for input validation. Defaults to SummarizationInput.

  • output_class (Type[Output], optional): Class for output validation. Defaults to SummarizationOutput.

  • name (Optional[str], optional): Name for identification. If equals to None, class name will be used. Defaults to None.




SummarizationInput

Subclass of IOModel.


__init__

Args:

  • inputs (str)

  • max_length (int)

  • min_length (int)




SummarizationOutput

Subclass of IOModel.


__init__

Args:

  • summary_text (str)




SummarizationPostprocess

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


execute

Arguments:

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

    • "output" (Any): Model output;

Returns:

  • Dict[str, Any]: Expected keys:

    • "summary_text" (str);



Last updated