Description
Pretrained BertForTokenClassification model, adapted from Hugging Face and curated to provide scalability and production-readiness using Spark NLP.mongolian_bert_base_demo_named_entity
is a Mongolian model originally trained by 2rtl3.
How to use
documentAssembler = DocumentAssembler() \
.setInputCol("text") \
.setOutputCol("documents")
tokenClassifier = BertForTokenClassification.pretrained("mongolian_bert_base_demo_named_entity","mn") \
.setInputCols(["documents","token"]) \
.setOutputCol("ner")
pipeline = Pipeline().setStages([documentAssembler, tokenClassifier])
pipelineModel = pipeline.fit(data)
pipelineDF = pipelineModel.transform(data)
val documentAssembler = new DocumentAssembler()
.setInputCol("text")
.setOutputCol("embeddings")
val tokenClassifier = BertForTokenClassification
.pretrained("mongolian_bert_base_demo_named_entity", "mn")
.setInputCols(Array("documents","token"))
.setOutputCol("ner")
val pipeline = new Pipeline().setStages(Array(documentAssembler, tokenClassifier))
val pipelineModel = pipeline.fit(data)
val pipelineDF = pipelineModel.transform(data)
Model Information
Model Name: | mongolian_bert_base_demo_named_entity |
Compatibility: | Spark NLP 5.2.0+ |
License: | Open Source |
Edition: | Official |
Input Labels: | [documents, token] |
Output Labels: | [ner] |
Language: | mn |
Size: | 665.1 MB |
References
https://huggingface.co/2rtl3/mn-bert-base-demo-named-entity