flair.tokenization.TokenizerWrapper#

class flair.tokenization.TokenizerWrapper(tokenizer_func)View on GitHub#

Bases: Tokenizer

Helper class to wrap tokenizer functions to the class-based tokenizer interface.

__init__(tokenizer_func)View on GitHub#

Methods

__init__(tokenizer_func)

from_dict(config)

Instantiate the tokenizer from a configuration dictionary.

to_dict()

Serialize the tokenizer's configuration to a dictionary.

tokenize(text)

Attributes

name

tokenize(text)View on GitHub#
Return type:

list[str]

property name: str#
to_dict()View on GitHub#

Serialize the tokenizer’s configuration to a dictionary.

Return type:

dict

classmethod from_dict(config)View on GitHub#

Instantiate the tokenizer from a configuration dictionary.

Return type:

TokenizerWrapper