gbert legal ner
PaDaS-LabGBERT-LEGAL-NER
Introduction
GBERT-LEGAL-NER is a German BERT model specifically designed for Legal Named Entity Recognition (NER). It can identify various legal entities in German text, making it useful for legal document analysis and related applications.
Architecture
This model is built using the BERT architecture and is optimized for token classification tasks. It is compatible with the Hugging Face transformers
library and can be used with either PyTorch or TensorFlow frameworks. The model supports Safetensors for efficient and safe storage of model parameters.
Training
The model was trained on datasets specifically curated for legal entity recognition tasks in the German language. It has been fine-tuned to recognize classes such as Person, Organization, Court, Law, and other legal entities.
Guide: Running Locally
To run GBERT-LEGAL-NER locally, follow these steps:
-
Install Required Libraries:
Install the Hugging Face transformers library:pip install transformers
-
Load the Model and Tokenizer:
Use the following Python code to load the model and tokenizer:from transformers import pipeline, AutoTokenizer, AutoModelForTokenClassification tokenizer = AutoTokenizer.from_pretrained("PaDaS-Lab/gbert-legal-ner", use_auth_token="AUTH_TOKEN") model = AutoModelForTokenClassification.from_pretrained("PaDaS-Lab/gbert-legal-ner", use_auth_token="AUTH_TOKEN") ner = pipeline("ner", model=model, tokenizer=tokenizer)
-
Run Inference:
Use the model for inference with a sample text:example = "1. Das Bundesarbeitsgericht ist gemäß § 9 Abs. 2 Satz 2 ArbGG iVm. § 201 Abs. 1 Satz 2 GVG für die beabsichtigte Klage gegen den Bund zuständig ." results = ner(example) print(results)
-
Hardware Recommendation:
For optimal performance, consider using cloud GPUs such as those provided by AWS, Google Cloud, or Azure.
License
Please reference the model's associated conference paper when using it in your work:
Darji, H., Mitrović, J., & Granitzer, M. (2023). German BERT Model for Legal Named Entity Recognition. In Proceedings of the 15th International Conference on Agents and Artificial Intelligence - Volume 3: ICAART. SciTePress. DOI: 10.5220/0011749400003393.