lblod/abb-legal-ner-nl-flanders
Viewer • Updated • 49 • 32
How to use lblod/multilingual-ner-abb-improved with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("token-classification", model="lblod/multilingual-ner-abb-improved") # Load model directly
from transformers import AutoTokenizer, AutoModelForTokenClassification
tokenizer = AutoTokenizer.from_pretrained("lblod/multilingual-ner-abb-improved")
model = AutoModelForTokenClassification.from_pretrained("lblod/multilingual-ner-abb-improved", device_map="auto")Multilingual (English, Dutch, German) NER model for legal/administrative decision documents.
This improved version adds native German training data (municipal decisions from Freiburg and Bamberg) on top of the original Dutch (Ghent) and English (translated) data, improving detection quality on German text and on text translated from German.
from transformers import pipeline
ner = pipeline("token-classification", model="PedroDKE/multilingual-ner-abb-improved", aggregation_strategy="simple")
# German
print(ner("Der Stadtrat der Stadt Bamberg hat am 12. März 2024 beschlossen."))
# Dutch
print(ner("De gemeenteraad van Gent heeft op 12 maart 2024 besloten."))
# English
print(ner("The city council of London decided on March 12, 2024."))
strict (seqeval, entity-level) micro on held-out validation set.
| Language | Samples | Precision | Recall | F1 |
|---|---|---|---|---|
| ALL | 920 | 0.766 | 0.823 | 0.794 |
| EN | 57 | 0.675 | 0.705 | 0.690 |
| NL | 69 | 0.751 | 0.783 | 0.767 |
| DE | 794 | 0.785 | 0.855 | 0.818 |
| Label | Precision | Recall | F1 | Support |
|---|---|---|---|---|
| ADMINISTRATIVE_BODY | 0.76 | 0.86 | 0.81 | 459 |
| DATE | 0.84 | 0.88 | 0.86 | 773 |
| LEGAL_GROUND | 0.82 | 0.85 | 0.84 | 362 |
| LOCATION | 0.61 | 0.66 | 0.63 | 678 |
| MANDATARY | 0.82 | 0.88 | 0.85 | 580 |
| Label | Precision | Recall | F1 | Support |
|---|---|---|---|---|
| ADMINISTRATIVE_BODY | 0.64 | 0.72 | 0.68 | 64 |
| DATE | 0.67 | 0.66 | 0.67 | 59 |
| LEGAL_GROUND | 0.63 | 0.75 | 0.69 | 32 |
| LOCATION | 0.38 | 0.62 | 0.47 | 32 |
| MANDATARY | 0.85 | 0.72 | 0.78 | 138 |
| Label | Precision | Recall | F1 | Support |
|---|---|---|---|---|
| ADMINISTRATIVE_BODY | 0.60 | 0.67 | 0.63 | 58 |
| DATE | 0.77 | 0.91 | 0.84 | 104 |
| LEGAL_GROUND | 0.67 | 0.74 | 0.71 | 47 |
| LOCATION | 0.70 | 0.61 | 0.65 | 174 |
| MANDATARY | 0.85 | 0.91 | 0.88 | 188 |
| Label | Precision | Recall | F1 | Support |
|---|---|---|---|---|
| ADMINISTRATIVE_BODY | 0.81 | 0.92 | 0.86 | 337 |
| DATE | 0.87 | 0.90 | 0.89 | 610 |
| LEGAL_GROUND | 0.88 | 0.88 | 0.88 | 283 |
| LOCATION | 0.61 | 0.68 | 0.64 | 472 |
| MANDATARY | 0.80 | 0.95 | 0.87 | 254 |
Base model
FacebookAI/xlm-roberta-base