orkgnlp.nli.templates.decoder.TemplatesRecommenderDecoder

class TemplatesRecommenderDecoder(templates)[source]

Bases: ORKGNLPBaseDecoder

The TemplatesRecommenderDecoder decodes the Templates Recommendation service model’s output to a user-friendly one.

Parameters

templates (List[Dict[str, str]]) – templates used for training the service models as premises.

Methods

decode

Decodes the model's output to a user-friendly format.

release_memory

Releases the memory of all available attributes in a pipeline component.

decode(model_output, top_n, **kwargs)[source]

Decodes the model’s output to a user-friendly format.

Parameters

model_output (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.