Lemma UD model for Norwegian (pos_nynorsklia)

Description

Pretrained Lemmatizer model (pos_nynorsklia) trained on Universal Dependencies 2.9 (UD_Norwegian-NynorskLIA) in Norwegian language.

Open in Colab Download Copy S3 URI

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") 

pos = PerceptronModel.pretrained("pos_nynorsklia", "no")\ 
    .setInputCols(["sentence", "token"])\ 
    .setOutputCol("pos")
    
pipeline = Pipeline(stages=[document, sentence, tokenizer, pos])
    
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 pos = PerceptronModel.pretrained("pos_nynorsklia", "no")
    .setInputCols("sentence", "token")
    .setOutputCol("pos")
    
val pipeline = new Pipeline().setStages(Array(document, sentence, tokenizer, pos))

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

val result = pipeline.fit(data).transform(data)
import nlu
nlu.load("no.pos.nynorsklia").predict("""I love Spark NLP""")

Model Information

Model Name: pos_nynorsklia
Compatibility: Spark NLP 3.4.3+
License: Open Source
Edition: Official
Input Labels: [sentence, form]
Output Labels: [pos]
Language: no
Size: 551.6 KB

References

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