Lemmatization

Lemmatization related modeling class

class pororo.tasks.lemmatization.PororoLemmatizationFactory(task: str, lang: str, model: Optional[str])[source]

Bases: pororo.tasks.utils.base.PororoFactoryBase

Conduct lemmatization

English (nltk)

  • dataset: N/A

  • metric: N/A

Parameters

sent (str) – input sentence to be lemmatized

Returns

lemma list generated by NLTK

Return type

List[str]

Examples

>>> lemma = Pororo(task="lemma", lang="en")
>>> lemma("The striped bats are hanging, on their feet for best.")
['The', 'striped', 'bat', 'be', 'hang', ',', 'on', 'their', 'foot', 'for', 'best',
static get_available_langs()[source]
static get_available_models()[source]
load(device: str)[source]

Load user-selected task-specific model

Parameters

device (str) – device information

Returns

User-selected task-specific model

Return type

object

class pororo.tasks.lemmatization.PororoNLTKLemmatize(nltk, model, config)[source]

Bases: pororo.tasks.utils.base.PororoSimpleBase

predict(sent: str, **kwargs)[source]

Conduct lemmatization with NLTK module

Parameters

sent (str) – input sentence to be lemmatized

Returns

lemma list generated by NLTK

Return type

List[str]