Morphological Inflection

Morphological Inflection related modeling class

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

Bases: pororo.tasks.utils.base.PororoFactoryBase

Conduct Morphological inflection

English (enparadigm)

  • dataset: TBU

  • metric: N/A

Korean (koparadigm)

  • dataset: KoParadigm (Park et al. 2020)

  • metric: N/A

Japanese (japaradigm)

  • dataset: TBU

  • metric: N/A

Parameters

text (str) – input text to be morphologically inflected

Returns

morphogical inflection token list

Return type

List[Tuple[str, Tuple[str, str]]]

Examples

>>> inflection = Pororo(task="inflection", lang="ko")
>>> inflection("곱")
[['Action Verb', [('거나', '곱거나'), ('거늘', '곱거늘'), ('거니', '곱거니') ...]]]
>>> inflection = Pororo(task="inflection", lang="en")
>>> inflection("love")
{'NN': [('loves', 'NNS')], 'VB': [('loves', 'VBZ'), ('loved', 'VBD'), ('loved', 'VBN'), ('loving', 'VBG')]}
>>> inflection = Pororo(task="inflection", lang="ja")
>>> inflection("あえぐ")
{'verb': [('あえが', '未然形'), ('あえご', '未然ウ接続'), ('あえぎ', '連用形'), ('あえい', '連用タ接続'), ('あえげ', '仮定形'), ('あえげ', '命令e'), ('あえぎゃ', '仮定縮約1')]}
static get_available_langs()[source]
static get_available_models()[source]
load(device: int)[source]

Load user-selected task-specific model

Parameters

device (str) – device information

Returns

User-selected task-specific model

Return type

object

class pororo.tasks.morph_inflection.PororoKoParadigm(model, config)[source]

Bases: pororo.tasks.utils.base.PororoSimpleBase

predict(text: str)[source]

Conduct korean morphological inflection

Parameters

text (str) – input text to be morphologically inflected

Returns

morphogical inflection token list

Return type

List[Tuple[str, Tuple[str, str]]]

class pororo.tasks.morph_inflection.PororoParadigm(model, config)[source]

Bases: pororo.tasks.utils.base.PororoSimpleBase

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

Conduct morphological inflection

Parameters

text (str) – input text to be morphologically inflected

Returns

morphogical inflection token list

Return type

List[Tuple[str, Tuple[str, str]]]