Lemma UD model for Icelandic (lemma_icepahc)

Description

Pretrained Lemmatizer model (lemma_icepahc) trained on Universal Dependencies 2.9 (UD_Icelandic-IcePaHC) in Icelandic language.

Open in Colab Download

How to use

          
document = DocumentAssembler()\ 
    .setInputCol("text")\ 
    .setOutputCol("document")

sentence = SentenceDetectorDLModel.pretrained("sentence_detector_dl", "xx")\ 
    .setInputCols(["document"])\ 
    .setOutputCol("sentence")

tokenizer = Tokenizer()\ 
    .setInputCols(["sentence"])\ 
    .setOutputCol("token") 

lemma = LemmatizerModel.pretrained("lemma_icepahc", "is")\ 
    .setInputCols(["sentence", "token"])\ 
    .setOutputCol("lemma")

pipeline = Pipeline(stages=[document, sentence, tokenizer, lemma])

data = spark.createDataFrame([["I love Spark NLP"]]).toDF("text")

result = pipeline.fit(data).transform(data)

val document = new DocumentAssembler()
    .setInputCol("text")
    .setOutputCol("document")

val sentence = SentenceDetectorDLModel.pretrained("sentence_detector_dl", "xx")
    .setInputCols("document")
    .setOutputCol("sentence")

val tokenizer = new Tokenizer() 
    .setInputCols("sentence") 
    .setOutputCol("token")

val lemma = LemmatizerModel.pretrained("lemma_icepahc", "is")
    .setInputCols("sentence", "token")
    .setOutputCol("lemma")

val pipeline = new Pipeline().setStages(Array(document, sentence, tokenizer, lemma))

val data = Seq("I love Spark NLP").toDF("text")

val result = pipeline.fit(data).transform(data)

Model Information

Model Name: lemma_icepahc
Compatibility: Spark NLP 3.4.3+
License: Open Source
Edition: Official
Input Labels: [form]
Output Labels: [lemma]
Language: is
Size: 705.3 KB

References

Model is trained on Universal Dependencies (treebank 2.9) UD_Icelandic-IcePaHC https://github.com/UniversalDependencies/UD_Icelandic-IcePaHC