Description
Pretrained RoBertaForTokenClassification model, adapted from Hugging Face and curated to provide scalability and production-readiness using Spark NLP.bertin_roberta_base_spanish_finetuned_sayula_popoluca
is a English model originally trained by dccuchile.
How to use
documentAssembler = DocumentAssembler() \
.setInputCol("text") \
.setOutputCol("document")
tokenizer = Tokenizer() \
.setInputCols(["document"]) \
.setOutputCol("token")
tokenClassifier = RoBertaForTokenClassification.pretrained("bertin_roberta_base_spanish_finetuned_sayula_popoluca","en") \
.setInputCols(["document","token"]) \
.setOutputCol("ner")
pipeline = Pipeline().setStages([documentAssembler, tokenizer, tokenClassifier])
pipelineModel = pipeline.fit(data)
pipelineDF = pipelineModel.transform(data)
val documentAssembler = new DocumentAssembler()
.setInputCol("text")
.setOutputCol("document")
val tokenizer = Tokenizer() \
.setInputCols(Array("document")) \
.setOutputCol("token")
val tokenClassifier = RoBertaForTokenClassification
.pretrained("bertin_roberta_base_spanish_finetuned_sayula_popoluca", "en")
.setInputCols(Array("document","token"))
.setOutputCol("ner")
val pipeline = new Pipeline().setStages(Array(documentAssembler, tokenizer, tokenClassifier))
val pipelineModel = pipeline.fit(data)
val pipelineDF = pipelineModel.transform(data)
Model Information
Model Name: | bertin_roberta_base_spanish_finetuned_sayula_popoluca |
Compatibility: | Spark NLP 5.2.1+ |
License: | Open Source |
Edition: | Official |
Input Labels: | [documents, token] |
Output Labels: | [ner] |
Language: | en |
Size: | 462.3 MB |
References
https://huggingface.co/dccuchile/bertin-roberta-base-spanish-finetuned-pos