Hungarian Lemmatizer


This model uses context and language knowledge to assign all forms and inflections of a word to a single root. This enables the pipeline to treat the past and present tense of a verb, for example, as the same word instead of two completely different words. The lemmatizer takes into consideration the context surrounding a word to determine which root is correct when the word form alone is ambiguous.

Open in Colab Download

How to use

lemmatizer = LemmatizerModel.pretrained("lemma", "hu") \
        .setInputCols(["token"]) \
nlp_pipeline = Pipeline(stages=[document_assembler, tokenizer, lemmatizer])
light_pipeline = LightPipeline([['']]).toDF("text")))
results = light_pipeline.fullAnnotate("Az északi király kivételével John Snow angol orvos, vezető szerepet játszik az érzéstelenítés és az orvosi higiénia fejlesztésében.")

val lemmatizer = LemmatizerModel.pretrained("lemma", "hu")


[Row(annotatorType='token', begin=0, end=1, result='Az', metadata={'sentence': '0'}, embeddings=[]),
Row(annotatorType='token', begin=3, end=8, result='északi', metadata={'sentence': '0'}, embeddings=[]),
Row(annotatorType='token', begin=10, end=15, result='király', metadata={'sentence': '0'}, embeddings=[]),
Row(annotatorType='token', begin=17, end=27, result='kivétel', metadata={'sentence': '0'}, embeddings=[]),
Row(annotatorType='token', begin=29, end=32, result='John', metadata={'sentence': '0'}, embeddings=[]),

Model Information

Model Name: lemma
Type: lemmatizer
Compatibility: Spark NLP 2.5.0+
Edition: Official
Input labels: [token]
Output labels: [lemma]
Language: hu
Case sensitive: false
License: Open Source

Data Source

The model is imported from