orkgnlp.common.service.base.ORKGNLPBaseEncoder
- class ORKGNLPBaseEncoder[source]
Bases:
EnforceOverrides
,PipelineExecutorComponent
The ORKGNLPBaseEncoder is the base encoder class. You can freely inherit this class, implement its
encode(raw_input, **kwargs)
function and use it to encode your user input to a model-friendly format.Using the ORKGNLPBaseEncoder as your service encoder results in passing the same user’s input to the model.
Methods
Encodes the
raw_input
to a model-friendly format.Releases the memory of all available attributes in a pipeline component.
- encode(raw_input, **kwargs)[source]
Encodes the
raw_input
to a model-friendly format.- Parameters
raw_input (
Any
) – The user’s input to be encoded.- Return type
Tuple
[Any
,Dict
[str
,Any
]]- Returns
The model-friendly output and kwargs.
- release_memory()
Releases the memory of all available attributes in a pipeline component.