Spanish Named Entity Recognition (Base, Plus, CAPITEL competition at IberLEF 2020 dataset)

Description

Pretrained Named Entity Recognition model, uploaded to Hugging Face, adapted and imported into Spark NLP. roberta-base-bne-capitel-ner-plus is a Spanish model orginally trained by PlanTL-GOB-ES.

Predicted Entities

ORG, OTH, LOC, PER

Download Copy S3 URICopied!

How to use

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

sentenceDetector = SentenceDetectorDLModel.pretrained("sentence_detector_dl", "xx")\
.setInputCols(["document"])\
.setOutputCol("sentence")

tokenizer = Tokenizer() \
.setInputCols("sentence") \
.setOutputCol("token")

tokenClassifier = RoBertaForTokenClassification.pretrained("roberta_ner_roberta_base_bne_capitel_ner_plus","es") \
.setInputCols(["sentence", "token"]) \
.setOutputCol("ner")

pipeline = Pipeline(stages=[documentAssembler, sentenceDetector, tokenizer, tokenClassifier])

data = spark.createDataFrame([["Amo Spark NLP"]]).toDF("text")

result = pipeline.fit(data).transform(data)

Model Information

Model Name: roberta_ner_roberta_base_bne_capitel_ner_plus
Compatibility: Spark NLP 3.4.2+
License: Open Source
Edition: Official
Input Labels: [document, token]
Output Labels: [ner]
Language: es
Size: 458.9 MB
Case sensitive: true
Max sentence length: 128

References

  • https://huggingface.co/PlanTL-GOB-ES/roberta-base-bne-capitel-ner-plus
  • https://arxiv.org/abs/1907.11692
  • http://www.bne.es/en/Inicio/index.html
  • https://sites.google.com/view/capitel2020
  • https://github.com/PlanTL-GOB-ES/lm-spanish
  • https://arxiv.org/abs/2107.07253