Views
No views yet
impresso-project/language-identifierimpresso-project/language-identifier is a multilingual language identification model fine-tuned for use on historical newspaper content. It supports German (de), French (fr), Italian (it), English (en), and Luxembourgish (lb) — the core languages of the Impresso Project, which focuses on analyzing historical media across national and linguistic borders.{'bucket': 200000,
'dimension': 40,
'hash_function': 'N/A',
'loss': 'softmax',
'maxn': 4,
'minn': 1,
'model_type': 'supervised',
'vocab_size': 3} de en fr it la lb nl
de 2854 0 79 3 0 38 0
en 0 156 1 0 0 0 0
fr 14 11 1515 1 7 9 0
it 0 0 0 136 0 0 0
la 0 0 0 0 0 0 0
lb 6 1 20 0 0 775 1
nl 0 0 0 0 0 0 0
Detailed Classification Report:
precision recall f1-score support
de 0.99 0.96 0.98 2974
en 0.93 0.99 0.96 157
fr 0.94 0.97 0.96 1557
it 0.97 1.00 0.99 136
la 0.00 0.00 0.00 0
lb 0.94 0.97 0.95 803
nl 0.00 0.00 0.00 0
accuracy 0.97 5627
macro avg 0.68 0.70 0.69 5627
weighted avg 0.97 0.97 0.97 56271from transformers import pipeline
2
3MODEL_NAME = "impresso-project/language-identifier"
4
5lang_pipeline = pipeline(
6 "langident",
7 model=MODEL_NAME,
8 trust_remote_code=True,
9 device="cpu",
10)
11
12text = """En l'an 1348, au plus fort des ravages de la peste noire à travers
13l'Europe, le Royaume de France se trouvait à la fois au bord du désespoir et
14face à une opportunité."""
15
16langs = lang_pipeline(text)
17print(langs)1{
2 "language": "fr",
3 "score": 1.0
4}pip install transformers floret