Lemmatizer (Catalan, SpacyLookup)


This Catalan Lemmatizer is an scalable, production-ready version of the Rule-based Lemmatizer available in Spacy Lookups Data repository.


How to use

documentAssembler = DocumentAssembler() \
    .setInputCol("text") \

tokenizer = Tokenizer() \
    .setInputCols(["document"]) \

lemmatizer = LemmatizerModel.pretrained("lemma_spacylookup","ca") \
    .setInputCols(["token"]) \

pipeline = Pipeline(stages=[documentAssembler, tokenizer, lemmatizer]) 

example = spark.createDataFrame([["No ets millor que jo"]], ["text"]) 

results = pipeline.fit(example).transform(example)
val documentAssembler = new DocumentAssembler() 

val tokenizer = new Tokenizer() 

val lemmatizer = LemmatizerModel.pretrained("lemma_spacylookup","ca") 

val pipeline = new Pipeline().setStages(Array(documentAssembler, tokenizer, lemmatizer))
val data = Seq("No ets millor que jo").toDF("text")
val results = pipeline.fit(data).transform(data)


|result                    |
|[No, ets, millor, que, jo]|

Model Information

Model Name: lemma_spacylookup
Compatibility: Spark NLP 3.4.1+
License: Open Source
Edition: Official
Input Labels: [token]
Output Labels: [lemma]
Language: ca
Size: 7.0 MB