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

Methods

release_memory

Releases the memory of all available pipeline components.

run

Executes a full pipline of the common service workflow:

release_memory()[source]

Releases the memory of all available pipeline components.

run(raw_input, **kwargs)[source]

Executes a full pipline of the common service workflow:

  1. Runs the service encoder with the user’s input.

  2. The encoded input is passed to the model runner, which in turn is executed.

  3. 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.