Downloads · 30 days
16
1% of all-time downloads
impresso-project/ner-stacked-bert-multilingual-light
ner-stacked-bert-multilingual-light is a token classification model from impresso-project. Use it when you need labels on individual words, such as names. It is set up for transformers.
The Impresso NER model is a multilingual named entity recognition model trained for historical document processing. It is based on a stacked Transformer architecture and is designed to identify fine-grained and coarse…
Downloads · 30 days
16
1% of all-time downloads
All-time downloads
1.7K
Public
Parameters
48.5M
363 MB on disk
Likes
2
Public
Click a slice to open those files.
.safetensors388 MB · 69%
From the Hugging Face model README
impresso-project/ner-stacked-bert-multilingual-lightThe Impresso NER model is a multilingual named entity recognition model trained for historical document processing. It is based on a stacked Transformer architecture and is designed to identify fine-grained and coarse-grained entity types in digitized historical texts, including names, titles, and locations.
This model is the same as
impresso-project/ner-stacked-bert-multilingualbut it requires the input already tokenised. This is used in production where the tokenisation comes from another preprocessing.
dbmdz/bert-medium-historic-multilingual-casedThe model architecture consists of the following components:
These additional Transformer layers help in mitigating the effects of OCR noise, spelling variation, and non-standard linguistic usage found in historical documents. The entire stack is fine-tuned end-to-end for token classification.
The model supports both coarse-grained and fine-grained entity types defined in the HIPE-2020/2022 guidelines. The output format of the model includes structured predictions with contextual and semantic details. Each prediction is a dictionary with the following fields:
{
'type': 'pers' | 'org' | 'loc' | 'time' | 'prod',
'confidence_ner': float, # Confidence score
'surface': str, # Surface form in text
'lOffset': int, # Start character offset
'rOffset': int, # End character offset
'name': str, # Optional: full name (for persons)
'title': str, # Optional: title (for persons)
'function': str # Optional: function (if detected)
}
If present in the text, surrounding an entity, model returns person-specific attributes such as:
name: canonical full nametitle: honorific or title (e.g., "king", "chancellor")function: role or function in context (if available)The model is intended to be used directly with the Hugging Face pipeline for token-classification, specifically with generic-ner tasks on historical texts.
Can be used for downstream tasks such as:
Due to training on historical documents, the model may reflect historical biases and inaccuracies. It may underperform on contemporary or non-European languages.
from transformers import AutoModelForTokenClassification, AutoTokenizer, pipeline
MODEL_NAME = "impresso-project/ner-stacked-bert-multilingual-light"
tokenizer = AutoTokenizer.from_pretrained(MODEL_NAME)
ner_pipeline = pipeline("generic-ner", model=MODEL_NAME, tokenizer=tokenizer, trust_remote_code=True, device='cpu')
sentence = "En l'an 1348, au plus fort des ravages de la peste noire à travers l'Europe, le Royaume de France se trouvait à la fois au bord du désespoir et face à une opportunité. À la cour du roi Philippe VI, les murs du Louvre étaient animés par les rapports sombres venus de Paris et des villes environnantes. La peste ne montrait aucun signe de répit, et le chancelier Guillaume de Nogaret, le conseiller le plus fidèle du roi, portait le lourd fardeau de gérer la survie du royaume."
entities = ner_pipeline(sentence, tokens=sentence.split())
print(entities)
[
{'type': 'time', 'confidence_ner': 85.0, 'surface': "an 1348", 'lOffset': 0, 'rOffset': 12},
{'type': 'loc', 'confidence_ner': 90.75, 'surface': "Europe", 'lOffset': 69, 'rOffset': 75},
{'type': 'loc', 'confidence_ner': 75.45, 'surface': "Royaume de France", 'lOffset': 80, 'rOffset': 97},
{'type': 'pers', 'confidence_ner': 85.27, 'surface': "roi Philippe VI", 'lOffset': 181, 'rOffset': 196, 'title': "roi", 'name': "roi Philippe VI"},
{'type': 'loc', 'confidence_ner': 30.59, 'surface': "Louvre", 'lOffset': 210, 'rOffset': 216},
{'type': 'loc', 'confidence_ner': 94.46, 'surface': "Paris", 'lOffset': 266, 'rOffset': 271},
{'type': 'pers', 'confidence_ner': 96.1, 'surface': "chancelier Guillaume de Nogaret", 'lOffset': 350, 'rOffset': 381, 'title': "chancelier", 'name': "Guillaume de Nogaret"},
{'type': 'loc', 'confidence_ner': 49.35, 'surface': "Royaume", 'lOffset': 80, 'rOffset': 87},
{'type': 'loc', 'confidence_ner': 24.18, 'surface': "France", 'lOffset': 91, 'rOffset': 97}
]
The model was trained on the Impresso HIPE-2020 dataset, a subset of the HIPE-2022 corpus, which includes richly annotated OCR-transcribed historical newspaper content.
OCR content was cleaned and segmented. Entity types follow the HIPE-2020 typology.
dbmdz/bert-medium-historic-multilingual-casedHeld-out portion of HIPE-2020 (French, German)
| Language | Precision | Recall | F1-score |
|---|---|---|---|
| French | 84.2 | 81.6 | 82.9 |
| German | 82.0 | 78.7 | 80.3 |
The model performs robustly across noisy OCR historical content with support for fine-grained entity typologies.
Stacked BERT architecture with multitask token classification head supporting HIPE-type entity labels.
1x NVIDIA TITAN X (Pascal, 12GB)
BibTeX:
@inproceedings{boros2020alleviating,
title={Alleviating digitization errors in named entity recognition for historical documents},
author={Boros, Emanuela and Hamdi, Ahmed and Pontes, Elvys Linhares and Cabrera-Diego, Luis-Adri{\'a}n and Moreno, Jose G and Sidere, Nicolas and Doucet, Antoine},
booktitle={Proceedings of the 24th conference on computational natural language learning},
pages={431--441},
year={2020}
}