orkgnlp.common.service.base.ORKGNLPBaseDecoder
- class ORKGNLPBaseDecoder[source]
Bases:
EnforceOverrides
,PipelineExecutorComponent
The ORKGNLPBaseDecoder is the base decoder class. You can freely inherit this class, implement its
decode(model_output, **kwargs)
function and use it to decode your model output to a user-friendly format.Using the ORKGNLPBaseDecoder as your service decoder results in returning the same model’s output to the user.
Methods
Decodes the model's
output
to a user-friendly format.Releases the memory of all available attributes in a pipeline component.
- decode(model_output, **kwargs)[source]
Decodes the model’s
output
to a user-friendly format.- Parameters
model_output (
Union
[Any
,Generator
[Any
,None
,None
]]) – The model’s output to be decoded.- Return type
Any
- Returns
The user-friendly output.
- release_memory()
Releases the memory of all available attributes in a pipeline component.