Views
No views yet
camembert-base-literary-NER-v2 is a french NER model trained on a dataset of 7 french novels by Maurel et al. (2025). Annotations guidelines are based on UniversalNER (Mayhew et al., 2024). The model supports PER, LOC, ORG and MISC entities. It was trained for 3 epochs with a learning rate of 1e-5.| Novel | Micro F1 |
|---|---|
| Les Trois Mousquetaires | 71.15 |
| Le Rouge et le Noir | 88.97 |
| Eugénie Grandet | 88.56 |
| Germinal | 89.94 |
| Bel-Ami | 87.13 |
| Notre-Dame de Paris | 75.70 |
| Madame Bovary | 88.25 |
| ------------------------- | ---------- |
| Global Micro F1 | 81.21 |
| Class | Micro F1 | Precision | Recall |
|---|---|---|---|
| PERS | 83.51 | 81.89 | 85.20 |
| LOC | 81.80 | 78.69 | 85.17 |
| ORG | 55.74 | 42.39 | 81.34 |
| OTHER | 34.08 | 25.15 | 52.86 |
1from renard.pipeline import Pipeline
2from renard.pipeline.tokenization import NLTKTokenizer
3from renard.pipeline.ner import BertNamedEntityRecognizer
4from renard.pipeline.character_unification import GraphRulesCharacterUnifier
5from renard.pipeline.graph_extraction import CoOccurrencesGraphExtractor
6
7pipeline = Pipeline(
8 [
9 NLTKTokenizer(),
10 BertNamedEntityRecognizer(
11 model="compnet-renard/camembert-base-literary-NER-v2"
12 ),
13 # Note the `ignore_leading_determiner=True` argument: since
14 # this model extracts entities with their leading determiners
15 # (e.g. "l'archidiacre Claude Frollo"), we signal the
16 # character unifier module to not take these into account in
17 # its unification rules.
18 GraphRulesCharacterUnifier(ignore_leading_determiner=True),
19 CoOccurrencesGraphExtractor(co_occurrences_dist=10),
20 ]
21)
22
23out = pipeline("Quasimodo affronte l'archidiacre Claude Frollo dans Notre-Dame.")
24print(out.entities)
25print(out.characters)1[NEREntity(tokens=['Quasimodo'], start_idx=0, end_idx=1, tag='PER'), NEREntity(tokens=["l'archidiacre", 'Claude', 'Frollo'], start_idx=2, end_idx=5, tag='PER'), NEREntity(tokens=['Notre-Dame'], start_idx=6, end_idx=7, tag='LOC')]
2[<Quasimodo, Gender.UNKNOWN, 1 mentions>, <l'archidiacre Claude Frollo, Gender.UNKNOWN, 1 mentions>]1@InProceedings{
2 authors = {Maurel, P. and Amalvy, A. and Labatut, V. and Alrahabi, M.},
3 title = {Du repérage à l’analyse : un modèle pour la reconnaissance d’entités nommées dans les textes littéraires en français},
4 booktitle = {Digital Humanities 2025 (to appear)},
5 year = {2025},
6}