Lemmatizer (Spanish, SpacyLookup)


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

Download Copy S3 URI

How to use

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

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

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

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

example = spark.createDataFrame([["No eres mejor que yo"]], ["text"]) 

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

val tokenizer = new Tokenizer() 

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

val pipeline = new Pipeline().setStages(Array(documentAssembler, tokenizer, lemmatizer))
val data = Seq("No eres mejor que yo").toDF("text")
val results = pipeline.fit(data).transform(data)
import nlu
nlu.load("es.lemma").predict("""No eres mejor que yo""")


|result                   |
|[No, ser, mejor, que, yo]|

Model Information

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