orkgnlp.common.service.base.PipelineExecutor
- class PipelineExecutor(encoder, runner, decoder)[source]
Bases:
object
The PipelineExecutor executes a full service workflow given its encoder, runner and decoder. See the
run
function description for further information.- Parameters
encoder (
ORKGNLPBaseEncoder
) – Service’s encoder.runner (
ORKGNLPBaseRunner
) – Service’s runner.decoder (
ORKGNLPBaseDecoder
) – Service’s decoder.
Methods
Releases the memory of all available pipeline components.
Executes a full pipline of the common service workflow:
- run(raw_input, **kwargs)[source]
Executes a full pipline of the common service workflow:
Runs the service encoder with the user’s input.
The encoded input is passed to the model runner, which in turn is executed.
The model’s output is decoded to a user-friendly format using the service’s decoder.
Note that the kwargs can be updated and passed through the pipeline components.
- Parameters
raw_input (
Any
) – User’s input to be encoded.kwargs (
Any
) – Named parameters for further processing config. Please check your used component documentation for specific parameter description.
- Return type
Any
- Returns
The decoded user-friendly output.
- Raises
orkgnlp.common.util.exceptions.ORKGNLPIllegalStateException – If either [Encoder, Runner, Decoder] is not initialized.