orkgnlp.annotation.csner.decoder.CSNerDecoder

class CSNerDecoder(alphabet)[source]

Bases: ORKGNLPBaseDecoder

The CSNerDecoder decodes the CS-NER service model’s output to a user-friendly one.

Parameters

alphabet (Dict[str, Dict[str, int]]) – Dict representing the word, char and label alphabets.

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, raw_texts, recover, **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.