German BertForTokenClassification Cased model (from mschiesser)

Description

Pretrained BertForTokenClassification model, adapted from Hugging Face and curated to provide scalability and production-readiness using Spark NLP. ner-bert-german is a German model originally trained by mschiesser.

Predicted Entities

LOC, ORG, PER

Download Copy S3 URICopied!

How to use

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

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

tokenClassifier = BertForTokenClassification.pretrained("bert_token_classifier_ner_german","de") \
    .setInputCols(["document", "token"]) \
    .setOutputCol("ner")

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

data = spark.createDataFrame([["PUT YOUR STRING HERE"]]).toDF("text")

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

Model Information

Model Name: bert_token_classifier_ner_german
Compatibility: Spark NLP 5.5.0+
License: Open Source
Edition: Official
Input Labels: [document, token]
Output Labels: [ner]
Language: de
Size: 665.1 MB

References

References

  • https://huggingface.co/mschiesser/ner-bert-german
  • https://en.wikipedia.org/wiki/Named-entity_recognition