Task
Base class for tasks
Subclass of Executable.
Module: core
Methods and properties
Main methods and properties
__init__
Arguments:
predictor (Predictor[Any, Any]): Predictor that will be used in task.
preprocess (Optional[Component], optional): Component executed before predictor.
postprocess (Optional[Component], optional): Component executed after predictor.
input_class (Type[Input]): Class for input validation.
output_class (Type[Output]): Class for output validation.
name (Optional[str], optional): Name for identification. If equals to None, class name will be used. Defaults to None.
process
Execute chain of actions
Arguments:
state (Transformable): Current data.
component (Optional[Component]): Component.
evaluator (Evaluator): Evaluator in context of which executed.
Returns:
Transformable: Result of execution.
invoke
Task main logic. Executes preprocess, than executes predictor, after that executes postprocess and returns result.
Arguments:
input_data (Input): Validated input data.
evaluator (Evaluator): Evaluator in context of which executed.
Returns:
Dict[str, Any]: Result of execution.
NERTask
Task that expected to have entities like objects as result. Subclass of Task. Type of Task[Input, NEROutputType].
NEROutputType
Type variable bounded to NEROutput.
NEROutput
Base class for output validation of NER tasks. Subclass of IOModel.
__init__
Arguments:
output (List[EntityType]): List of entities.
Last updated