pyprocessors-coreference 1.6.22__tar.gz → 1.6.26__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. {pyprocessors_coreference-1.6.22 → pyprocessors_coreference-1.6.26}/PKG-INFO +3 -2
  2. {pyprocessors_coreference-1.6.22 → pyprocessors_coreference-1.6.26}/README.md +2 -1
  3. {pyprocessors_coreference-1.6.22 → pyprocessors_coreference-1.6.26}/docs/adr/0001-linking-candidats-entityfishing-decision-jev.md +7 -2
  4. {pyprocessors_coreference-1.6.22 → pyprocessors_coreference-1.6.26}/docs/sherpa/coreference.en.md +18 -17
  5. {pyprocessors_coreference-1.6.22 → pyprocessors_coreference-1.6.26}/docs/sherpa/coreference.fr.md +18 -17
  6. {pyprocessors_coreference-1.6.22 → pyprocessors_coreference-1.6.26}/src/pyprocessors_coreference/__init__.py +1 -1
  7. {pyprocessors_coreference-1.6.22 → pyprocessors_coreference-1.6.26}/src/pyprocessors_coreference/coreference.py +7 -3
  8. {pyprocessors_coreference-1.6.22 → pyprocessors_coreference-1.6.26}/.claude/settings.json +0 -0
  9. {pyprocessors_coreference-1.6.22 → pyprocessors_coreference-1.6.26}/.gitignore +0 -0
  10. {pyprocessors_coreference-1.6.22 → pyprocessors_coreference-1.6.26}/.gitmodules +0 -0
  11. {pyprocessors_coreference-1.6.22 → pyprocessors_coreference-1.6.26}/.python-version +0 -0
  12. {pyprocessors_coreference-1.6.22 → pyprocessors_coreference-1.6.26}/LICENSE +0 -0
  13. {pyprocessors_coreference-1.6.22 → pyprocessors_coreference-1.6.26}/pyproject.toml +0 -0
  14. {pyprocessors_coreference-1.6.22 → pyprocessors_coreference-1.6.26}/submodules/python-archetype/.claude-plugin/marketplace.json +0 -0
  15. {pyprocessors_coreference-1.6.22 → pyprocessors_coreference-1.6.26}/submodules/python-archetype/.claude-plugin/plugin.json +0 -0
  16. {pyprocessors_coreference-1.6.22 → pyprocessors_coreference-1.6.26}/submodules/python-archetype/HOWTO.md +0 -0
  17. {pyprocessors_coreference-1.6.22 → pyprocessors_coreference-1.6.26}/submodules/python-archetype/README.md +0 -0
  18. {pyprocessors_coreference-1.6.22 → pyprocessors_coreference-1.6.26}/submodules/python-archetype/resources/Stages.yml +0 -0
  19. {pyprocessors_coreference-1.6.22 → pyprocessors_coreference-1.6.26}/submodules/python-archetype/resources/help/help_examples.py +0 -0
  20. {pyprocessors_coreference-1.6.22 → pyprocessors_coreference-1.6.26}/submodules/python-archetype/resources/help/plugin-help.py +0 -0
  21. {pyprocessors_coreference-1.6.22 → pyprocessors_coreference-1.6.26}/submodules/python-archetype/resources/help/template.en.md +0 -0
  22. {pyprocessors_coreference-1.6.22 → pyprocessors_coreference-1.6.26}/submodules/python-archetype/resources/help/template.fr.md +0 -0
  23. {pyprocessors_coreference-1.6.22 → pyprocessors_coreference-1.6.26}/submodules/python-archetype/skills/new-plugin/SKILL.md +0 -0
  24. {pyprocessors_coreference-1.6.22 → pyprocessors_coreference-1.6.26}/submodules/python-archetype/skills/new-plugin/references/annotator.md +0 -0
  25. {pyprocessors_coreference-1.6.22 → pyprocessors_coreference-1.6.26}/submodules/python-archetype/skills/new-plugin/references/converter.md +0 -0
  26. {pyprocessors_coreference-1.6.22 → pyprocessors_coreference-1.6.26}/submodules/python-archetype/skills/new-plugin/references/formatter.md +0 -0
  27. {pyprocessors_coreference-1.6.22 → pyprocessors_coreference-1.6.26}/submodules/python-archetype/skills/new-plugin/references/importer.md +0 -0
  28. {pyprocessors_coreference-1.6.22 → pyprocessors_coreference-1.6.26}/submodules/python-archetype/skills/new-plugin/references/processor.md +0 -0
  29. {pyprocessors_coreference-1.6.22 → pyprocessors_coreference-1.6.26}/submodules/python-archetype/skills/new-plugin/references/segmenter.md +0 -0
  30. {pyprocessors_coreference-1.6.22 → pyprocessors_coreference-1.6.26}/submodules/python-archetype/skills/new-plugin/references/types.md +0 -0
  31. {pyprocessors_coreference-1.6.22 → pyprocessors_coreference-1.6.26}/submodules/python-archetype/skills/plugin-help/SKILL.md +0 -0
  32. {pyprocessors_coreference-1.6.22 → pyprocessors_coreference-1.6.26}/submodules/python-archetype/tools/check-marketplace.py +0 -0
  33. {pyprocessors_coreference-1.6.22 → pyprocessors_coreference-1.6.26}/submodules/python-archetype/vars/pythonPipeline.groovy +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: pyprocessors-coreference
3
- Version: 1.6.22
3
+ Version: 1.6.26
4
4
  Summary: Processor grouping the mentions of the same entity
5
5
  Project-URL: Homepage, https://bitbucket.org/kairntech/pyprocessors_coreference
6
6
  Author-email: Olivier Terrier <olivier.terrier@kairntech.com>
@@ -77,6 +77,7 @@ Sur chaque annotation d'un label regroupé, il écrit dans `properties` :
77
77
  | `entity_group` | l'identifiant du groupe dans le document : `g1`, `g2`… dans l'ordre de première apparition |
78
78
  | `canonical_form` | la forme la plus longue du groupe, sans civilité : c'est elle qu'on cherche dans la base de connaissances |
79
79
  | `mention_type` | `name` (les périphrases et les pronoms, `nominal` et `pronoun`, viendront avec les paliers 2 et 3) |
80
+ | `family` | la famille du label, par le nom d'un label (`location` pour `afplocation`, `person_family` pour les personnes) : `entityfishing_candidates` peut mapper ce label pour toute la famille |
80
81
  | `entity_group_candidates` | seulement sur un nom partiel ambigu : les groupes auxquels il peut appartenir |
81
82
 
82
83
  Les autres propriétés de l'annotation sont gardées, et traiter deux fois un document
@@ -118,7 +119,7 @@ document = Document(
118
119
  | Paramètre | Défaut | Description |
119
120
  |-----------|--------|-------------|
120
121
  | `labels` | vide | Labels des mentions à regrouper. Vide : tous les labels. |
121
- | `label_families` | vide | Familles de labels regroupés comme un seul, chaque label associé à sa famille, les labels de même famille regroupés : un autre label (`loc_org` → `organization`) ou un nom libre (`loc_org` → `1`, `organization` → `1`). Un label non déclaré rejoint la famille du label le plus court qui termine son nom. |
122
+ | `label_families` | vide | Familles de labels regroupés comme un seul, chaque label associé à sa famille, les labels de même famille regroupés : un autre label (`loc_org` → `organization`), dont le nom est écrit dans la propriété `family` des mentions. Un label non déclaré rejoint la famille du label le plus court qui termine son nom. |
122
123
  | `person_family` | `person` | Famille des noms de personne : ses labels forment un seul groupe, et la règle du nom partiel s'y applique. Un label d'un autre nom la rejoint par `label_families` (`PER` → `person`). |
123
124
  | `honorifics` | `M.`, `Mme`, `Dr`, `Mr`… | Civilités ignorées en tête d'un nom de personne. Paramètre avancé. |
124
125
 
@@ -47,6 +47,7 @@ Sur chaque annotation d'un label regroupé, il écrit dans `properties` :
47
47
  | `entity_group` | l'identifiant du groupe dans le document : `g1`, `g2`… dans l'ordre de première apparition |
48
48
  | `canonical_form` | la forme la plus longue du groupe, sans civilité : c'est elle qu'on cherche dans la base de connaissances |
49
49
  | `mention_type` | `name` (les périphrases et les pronoms, `nominal` et `pronoun`, viendront avec les paliers 2 et 3) |
50
+ | `family` | la famille du label, par le nom d'un label (`location` pour `afplocation`, `person_family` pour les personnes) : `entityfishing_candidates` peut mapper ce label pour toute la famille |
50
51
  | `entity_group_candidates` | seulement sur un nom partiel ambigu : les groupes auxquels il peut appartenir |
51
52
 
52
53
  Les autres propriétés de l'annotation sont gardées, et traiter deux fois un document
@@ -88,7 +89,7 @@ document = Document(
88
89
  | Paramètre | Défaut | Description |
89
90
  |-----------|--------|-------------|
90
91
  | `labels` | vide | Labels des mentions à regrouper. Vide : tous les labels. |
91
- | `label_families` | vide | Familles de labels regroupés comme un seul, chaque label associé à sa famille, les labels de même famille regroupés : un autre label (`loc_org` → `organization`) ou un nom libre (`loc_org` → `1`, `organization` → `1`). Un label non déclaré rejoint la famille du label le plus court qui termine son nom. |
92
+ | `label_families` | vide | Familles de labels regroupés comme un seul, chaque label associé à sa famille, les labels de même famille regroupés : un autre label (`loc_org` → `organization`), dont le nom est écrit dans la propriété `family` des mentions. Un label non déclaré rejoint la famille du label le plus court qui termine son nom. |
92
93
  | `person_family` | `person` | Famille des noms de personne : ses labels forment un seul groupe, et la règle du nom partiel s'y applique. Un label d'un autre nom la rejoint par `label_families` (`PER` → `person`). |
93
94
  | `honorifics` | `M.`, `Mme`, `Dr`, `Mr`… | Civilités ignorées en tête d'un nom de personne. Paramètre avancé. |
94
95
 
@@ -29,7 +29,7 @@ date: 2026-09-24
29
29
  - `properties.entity_group` : l'identifiant du groupe dans le document ;
30
30
  - `properties.canonical_form` : la forme la plus longue du groupe, qui sert au term lookup.
31
31
 
32
- Les règles s'appliquent toujours entre mentions de même label NER :
32
+ Les règles s'appliquent toujours entre mentions de même famille de labels (voir plus bas) :
33
33
  - **même surface normalisée → même groupe** ;
34
34
  - **PERSON seulement : un nom partiel rejoint un nom complet vu dans le document** (« Macron » rejoint « Emmanuel Macron ») ;
35
35
  - **un nom partiel ambigu n'est pas fusionné de force** : avec Emmanuel et Brigitte Macron dans le même texte, « Macron » garde ses deux groupes possibles.
@@ -43,7 +43,12 @@ Il était prévu de l'extraire. **Le palier 1 a finalement réécrit la règle**
43
43
 
44
44
  ## Ce que le palier 1 fait, et ses limites connues
45
45
 
46
- **Une décision prise en l'écrivant : les labels de personne forment une seule famille.** Dans le pipeline AFP, le NER (`person`) et le lexique AFP (`afpperson`) annotent le **même span**. Grouper strictement par label mettait chaque personne dans deux groupes. Le paramètre `person_labels` désigne ces labels ; s'il est vide, ce sont ceux dont le nom contient « person ». Les autres labels restent groupés par label exact : `location`/`afplocation` et `organization`/`afporganization` ont sans doute le même doublon, et la question reste ouverte.
46
+ **Une décision prise en l'écrivant : on groupe par famille de labels, pas par label exact.** Dans le pipeline AFP, le NER et le lexique AFP annotent le **même span** avec deux labels : `person`/`afpperson`, `location`/`afplocation`, `organization`/`afporganization`. Grouper strictement par label mettait chaque entité dans deux groupes. D'où trois règles :
47
+ - **suffixe** : un label dont le nom finit par un autre label connu est de sa famille (`afplocation` avec `location`) ;
48
+ - **déclaration** : le paramètre `label_families` associe un label à sa famille, un autre label (`loc_org` → `organization`) ; les labels associés à la même valeur forment une famille. C'est un dictionnaire plutôt qu'une liste de lignes, pour que Sherpa propose les labels connus en clé comme en valeur. La famille est donc toujours le nom d'un label : la coreference l'écrit dans la propriété `family` de chaque mention groupée, et `entityfishing_candidates` peut mapper ce label pour toute la famille ;
49
+ - **personnes** : le paramètre `person_family` (par défaut `person`) désigne la famille des noms de personne, la seule où s'appliquent le nom partiel et le retrait des civilités. `person` et `afpperson` y entrent par suffixe, `PER` par `label_families` (`PER` → `person`).
50
+
51
+ Un premier jet avait un paramètre `person_labels` (vide : les labels dont le nom contient « person »), et groupait les autres labels par label exact. `label_families` le rendait redondant : il a été remplacé par `person_family`.
47
52
 
48
53
  **Ce qu'est une « fin de nom ».** Le nom partiel rejoint le nom complet si ses mots sont **exactement les derniers mots** du nom complet. La comparaison se fait mot à mot, après normalisation (casse, espaces, apostrophes, civilités), jamais sur une partie de mot :
49
54
 
@@ -36,6 +36,7 @@ The processor neither creates nor removes annotations. It adds **properties** to
36
36
  | `entity_group` | the group identifier, the same for all the mentions of an entity in the document, numbered in order of appearance | `g1` |
37
37
  | `canonical_form` | the longest form of the group, without title: the most words, then the most characters | `Emmanuel Macron` |
38
38
  | `mention_type` | the type of mention, always `name` | `name` |
39
+ | `family` | the family of the label, by the name of a label: the one the linking step may map for the whole family | `location` for `afplocation` |
39
40
  | `entity_group_candidates` | only for an ambiguous partial name: the groups it could belong to | `["g1", "g2"]` |
40
41
 
41
42
  Properties the annotation already carried are kept. Processing the same document twice gives the same result.
@@ -47,7 +48,7 @@ Properties the annotation already carried are kept. Processing the same document
47
48
  | Parameter | Default | Effect |
48
49
  |---|---|---|
49
50
  | **Labels** (`labels`) | — (all labels) | Labels of the mentions to group. Annotations of other labels get no property. Empty, all annotations are grouped. |
50
- | **Label Families** (`label_families`) | — | Families of labels grouped as one, each label mapped to its family, the labels mapped to the same family grouped together: another label (`loc_org` → `organization`) or any name (`loc_org` → `1`, `organization` → `1`).<br/> A label not declared here belongs to the family of the shortest label that ends its name (afplocation with location). |
51
+ | **Label Families** (`label_families`) | — | Families of labels grouped as one, each label mapped to its family, the labels mapped to the same family grouped together: another label (`loc_org` → `organization`), whose name is written in the `family` property of the mentions.<br/> A label not declared here belongs to the family of the shortest label that ends its name (afplocation with location). |
51
52
  | **Person Family** (`person_family`) *(advanced)* | `person` | Family of person names: its labels form a single group (`person` and `afpperson`), and only these names benefit from the partial-name rule ("Macron" joins "Emmanuel Macron"). A label of another name joins it through **Label Families** (`PER` → `person`). |
52
53
  | **Honorifics** (`honorifics`) *(advanced)* | `["M.", "MM.", "Mme", "Mmes", "Mlle", "Mlles", "Me", "Dr", "Dr.", "Pr", "Pr.", "Mr", "Mr.", "Mrs", …` | Titles ignored in front of a person name, regardless of case. They are not part of the canonical form either. |
53
54
 
@@ -96,9 +97,9 @@ Output annotations:
96
97
 
97
98
  | Annotated text | Label | Score | Properties |
98
99
  |---|---|---|---|
99
- | Emmanuel Macron | `person` | 1.00 | `canonical_form`: Emmanuel Macron<br>`entity_group`: g1<br>`mention_type`: name |
100
- | M. Macron | `person` | 1.00 | `canonical_form`: Emmanuel Macron<br>`entity_group`: g1<br>`mention_type`: name |
101
- | Emmanuel | `person` | 1.00 | `canonical_form`: Emmanuel<br>`entity_group`: g2<br>`mention_type`: name |
100
+ | Emmanuel Macron | `person` | 1.00 | `canonical_form`: Emmanuel Macron<br>`entity_group`: g1<br>`family`: person<br>`mention_type`: name |
101
+ | M. Macron | `person` | 1.00 | `canonical_form`: Emmanuel Macron<br>`entity_group`: g1<br>`family`: person<br>`mention_type`: name |
102
+ | Emmanuel | `person` | 1.00 | `canonical_form`: Emmanuel<br>`entity_group`: g2<br>`family`: person<br>`mention_type`: name |
102
103
 
103
104
  <!-- /generated:example:partial-name -->
104
105
 
@@ -126,9 +127,9 @@ Output annotations:
126
127
 
127
128
  | Annotated text | Label | Score | Properties |
128
129
  |---|---|---|---|
129
- | Emmanuel Macron | `person` | 1.00 | `canonical_form`: Emmanuel Macron<br>`entity_group`: g1<br>`mention_type`: name |
130
- | Brigitte Macron | `person` | 1.00 | `canonical_form`: Brigitte Macron<br>`entity_group`: g2<br>`mention_type`: name |
131
- | Macron | `person` | 1.00 | `canonical_form`: Macron<br>`entity_group`: g3<br>`entity_group_candidates`: ["g1", "g2"]<br>`mention_type`: name |
130
+ | Emmanuel Macron | `person` | 1.00 | `canonical_form`: Emmanuel Macron<br>`entity_group`: g1<br>`family`: person<br>`mention_type`: name |
131
+ | Brigitte Macron | `person` | 1.00 | `canonical_form`: Brigitte Macron<br>`entity_group`: g2<br>`family`: person<br>`mention_type`: name |
132
+ | Macron | `person` | 1.00 | `canonical_form`: Macron<br>`entity_group`: g3<br>`entity_group_candidates`: ["g1", "g2"]<br>`family`: person<br>`mention_type`: name |
132
133
 
133
134
  <!-- /generated:example:ambiguous -->
134
135
 
@@ -157,10 +158,10 @@ Output annotations:
157
158
 
158
159
  | Annotated text | Label | Score | Properties |
159
160
  |---|---|---|---|
160
- | Airbus Defence and Space | `organisation` | 1.00 | `canonical_form`: Airbus Defence and Space<br>`entity_group`: g1<br>`mention_type`: name |
161
- | AIRBUS | `organisation` | 1.00 | `canonical_form`: AIRBUS<br>`entity_group`: g2<br>`mention_type`: name |
162
- | George Washington | `person` | 1.00 | `canonical_form`: George Washington<br>`entity_group`: g3<br>`mention_type`: name |
163
- | Washington | `lieu` | 1.00 | `canonical_form`: Washington<br>`entity_group`: g4<br>`mention_type`: name |
161
+ | Airbus Defence and Space | `organisation` | 1.00 | `canonical_form`: Airbus Defence and Space<br>`entity_group`: g1<br>`family`: organisation<br>`mention_type`: name |
162
+ | AIRBUS | `organisation` | 1.00 | `canonical_form`: AIRBUS<br>`entity_group`: g2<br>`family`: organisation<br>`mention_type`: name |
163
+ | George Washington | `person` | 1.00 | `canonical_form`: George Washington<br>`entity_group`: g3<br>`family`: person<br>`mention_type`: name |
164
+ | Washington | `lieu` | 1.00 | `canonical_form`: Washington<br>`entity_group`: g4<br>`family`: lieu<br>`mention_type`: name |
164
165
 
165
166
  <!-- /generated:example:other-labels -->
166
167
 
@@ -188,9 +189,9 @@ Output annotations:
188
189
 
189
190
  | Annotated text | Label | Score | Properties |
190
191
  |---|---|---|---|
191
- | PSG *(#1)* | `loc_org` | 1.00 | `canonical_form`: PSG<br>`entity_group`: g1<br>`mention_type`: name |
192
- | Parc des Princes | `location` | 1.00 | `canonical_form`: Parc des Princes<br>`entity_group`: g2<br>`mention_type`: name |
193
- | PSG *(#2)* | `organization` | 1.00 | `canonical_form`: PSG<br>`entity_group`: g1<br>`mention_type`: name |
192
+ | PSG *(#1)* | `loc_org` | 1.00 | `canonical_form`: PSG<br>`entity_group`: g1<br>`family`: organization<br>`mention_type`: name |
193
+ | Parc des Princes | `location` | 1.00 | `canonical_form`: Parc des Princes<br>`entity_group`: g2<br>`family`: location<br>`mention_type`: name |
194
+ | PSG *(#2)* | `organization` | 1.00 | `canonical_form`: PSG<br>`entity_group`: g1<br>`family`: organization<br>`mention_type`: name |
194
195
 
195
196
  <!-- /generated:example:label-families -->
196
197
 
@@ -217,7 +218,7 @@ Output annotations:
217
218
 
218
219
  | Annotated text | Label | Score | Properties |
219
220
  |---|---|---|---|
220
- | Emmanuel Macron | `person` | 1.00 | `canonical_form`: Emmanuel Macron<br>`entity_group`: g1<br>`mention_type`: name |
221
+ | Emmanuel Macron | `person` | 1.00 | `canonical_form`: Emmanuel Macron<br>`entity_group`: g1<br>`family`: person<br>`mention_type`: name |
221
222
  | Washington | `lieu` | 1.00 | — |
222
223
 
223
224
  <!-- /generated:example:labels -->
@@ -245,8 +246,8 @@ Output annotations:
245
246
 
246
247
  | Annotated text | Label | Score | Properties |
247
248
  |---|---|---|---|
248
- | Emmanuel Macron | `PER` | 1.00 | `canonical_form`: Emmanuel Macron<br>`entity_group`: g1<br>`mention_type`: name |
249
- | Macron | `PER` | 1.00 | `canonical_form`: Emmanuel Macron<br>`entity_group`: g1<br>`mention_type`: name |
249
+ | Emmanuel Macron | `PER` | 1.00 | `canonical_form`: Emmanuel Macron<br>`entity_group`: g1<br>`family`: person<br>`mention_type`: name |
250
+ | Macron | `PER` | 1.00 | `canonical_form`: Emmanuel Macron<br>`entity_group`: g1<br>`family`: person<br>`mention_type`: name |
250
251
 
251
252
  <!-- /generated:example:person-family -->
252
253
 
@@ -36,6 +36,7 @@ Le processeur ne crée ni ne supprime d'annotation. Il ajoute des **propriétés
36
36
  | `entity_group` | l'identifiant du groupe, le même pour toutes les mentions d'une entité dans le document, numéroté dans l'ordre d'apparition | `g1` |
37
37
  | `canonical_form` | la forme la plus longue du groupe, sans civilité : le plus de mots, puis le plus de caractères | `Emmanuel Macron` |
38
38
  | `mention_type` | le type de mention, toujours `name` | `name` |
39
+ | `family` | la famille du label, par le nom d'un label : celui que l'étape de linking peut mapper pour toute la famille | `location` pour `afplocation` |
39
40
  | `entity_group_candidates` | seulement pour un nom partiel ambigu : les groupes auxquels il pourrait appartenir | `["g1", "g2"]` |
40
41
 
41
42
  Les propriétés que l'annotation portait déjà sont conservées. Traiter deux fois le même document donne le même résultat.
@@ -47,7 +48,7 @@ Les propriétés que l'annotation portait déjà sont conservées. Traiter deux
47
48
  | Paramètre | Valeur par défaut | Effet |
48
49
  |---|---|---|
49
50
  | **Labels** (`labels`) | — (tous les labels) | Labels des mentions à regrouper. Les annotations des autres labels ne reçoivent aucune propriété. Vide, toutes les annotations sont regroupées. |
50
- | **Label Families** (`label_families`) | — | Familles de labels regroupés comme un seul, chaque label associé à sa famille, les labels de même famille regroupés : un autre label (`loc_org` → `organization`) ou un nom libre (`loc_org` → `1`, `organization` → `1`). Un label non déclaré ici rejoint la famille du label le plus court qui termine son nom (`afplocation` avec `location`). |
51
+ | **Label Families** (`label_families`) | — | Familles de labels regroupés comme un seul, chaque label associé à sa famille, les labels de même famille regroupés : un autre label (`loc_org` → `organization`), dont le nom est écrit dans la propriété `family` des mentions. Un label non déclaré ici rejoint la famille du label le plus court qui termine son nom (`afplocation` avec `location`). |
51
52
  | **Person Family** (`person_family`) *(avancé)* | `person` | Famille des noms de personne : ses labels forment un seul groupe (`person` et `afpperson`), et seuls ces noms bénéficient de la règle du nom partiel (« Macron » rejoint « Emmanuel Macron »). Un label d'un autre nom la rejoint par **Label Families** (`PER` → `person`). |
52
53
  | **Honorifics** (`honorifics`) *(avancé)* | `["M.", "MM.", "Mme", "Mmes", "Mlle", "Mlles", "Me", "Dr", "Dr.", "Pr", "Pr.", "Mr", "Mr.", "Mrs", …` | Civilités ignorées devant un nom de personne, sans tenir compte des majuscules. Elles ne figurent pas non plus dans la forme canonique. |
53
54
 
@@ -96,9 +97,9 @@ Annotations en sortie :
96
97
 
97
98
  | Texte annoté | Label | Score | Propriétés |
98
99
  |---|---|---|---|
99
- | Emmanuel Macron | `person` | 1,00 | `canonical_form` : Emmanuel Macron<br>`entity_group` : g1<br>`mention_type` : name |
100
- | M. Macron | `person` | 1,00 | `canonical_form` : Emmanuel Macron<br>`entity_group` : g1<br>`mention_type` : name |
101
- | Emmanuel | `person` | 1,00 | `canonical_form` : Emmanuel<br>`entity_group` : g2<br>`mention_type` : name |
100
+ | Emmanuel Macron | `person` | 1,00 | `canonical_form` : Emmanuel Macron<br>`entity_group` : g1<br>`family` : person<br>`mention_type` : name |
101
+ | M. Macron | `person` | 1,00 | `canonical_form` : Emmanuel Macron<br>`entity_group` : g1<br>`family` : person<br>`mention_type` : name |
102
+ | Emmanuel | `person` | 1,00 | `canonical_form` : Emmanuel<br>`entity_group` : g2<br>`family` : person<br>`mention_type` : name |
102
103
 
103
104
  <!-- /generated:example:partial-name -->
104
105
 
@@ -126,9 +127,9 @@ Annotations en sortie :
126
127
 
127
128
  | Texte annoté | Label | Score | Propriétés |
128
129
  |---|---|---|---|
129
- | Emmanuel Macron | `person` | 1,00 | `canonical_form` : Emmanuel Macron<br>`entity_group` : g1<br>`mention_type` : name |
130
- | Brigitte Macron | `person` | 1,00 | `canonical_form` : Brigitte Macron<br>`entity_group` : g2<br>`mention_type` : name |
131
- | Macron | `person` | 1,00 | `canonical_form` : Macron<br>`entity_group` : g3<br>`entity_group_candidates` : ["g1", "g2"]<br>`mention_type` : name |
130
+ | Emmanuel Macron | `person` | 1,00 | `canonical_form` : Emmanuel Macron<br>`entity_group` : g1<br>`family` : person<br>`mention_type` : name |
131
+ | Brigitte Macron | `person` | 1,00 | `canonical_form` : Brigitte Macron<br>`entity_group` : g2<br>`family` : person<br>`mention_type` : name |
132
+ | Macron | `person` | 1,00 | `canonical_form` : Macron<br>`entity_group` : g3<br>`entity_group_candidates` : ["g1", "g2"]<br>`family` : person<br>`mention_type` : name |
132
133
 
133
134
  <!-- /generated:example:ambiguous -->
134
135
 
@@ -157,10 +158,10 @@ Annotations en sortie :
157
158
 
158
159
  | Texte annoté | Label | Score | Propriétés |
159
160
  |---|---|---|---|
160
- | Airbus Defence and Space | `organisation` | 1,00 | `canonical_form` : Airbus Defence and Space<br>`entity_group` : g1<br>`mention_type` : name |
161
- | AIRBUS | `organisation` | 1,00 | `canonical_form` : AIRBUS<br>`entity_group` : g2<br>`mention_type` : name |
162
- | George Washington | `person` | 1,00 | `canonical_form` : George Washington<br>`entity_group` : g3<br>`mention_type` : name |
163
- | Washington | `lieu` | 1,00 | `canonical_form` : Washington<br>`entity_group` : g4<br>`mention_type` : name |
161
+ | Airbus Defence and Space | `organisation` | 1,00 | `canonical_form` : Airbus Defence and Space<br>`entity_group` : g1<br>`family` : organisation<br>`mention_type` : name |
162
+ | AIRBUS | `organisation` | 1,00 | `canonical_form` : AIRBUS<br>`entity_group` : g2<br>`family` : organisation<br>`mention_type` : name |
163
+ | George Washington | `person` | 1,00 | `canonical_form` : George Washington<br>`entity_group` : g3<br>`family` : person<br>`mention_type` : name |
164
+ | Washington | `lieu` | 1,00 | `canonical_form` : Washington<br>`entity_group` : g4<br>`family` : lieu<br>`mention_type` : name |
164
165
 
165
166
  <!-- /generated:example:other-labels -->
166
167
 
@@ -188,9 +189,9 @@ Annotations en sortie :
188
189
 
189
190
  | Texte annoté | Label | Score | Propriétés |
190
191
  |---|---|---|---|
191
- | PSG *(n°1)* | `loc_org` | 1,00 | `canonical_form` : PSG<br>`entity_group` : g1<br>`mention_type` : name |
192
- | Parc des Princes | `location` | 1,00 | `canonical_form` : Parc des Princes<br>`entity_group` : g2<br>`mention_type` : name |
193
- | PSG *(n°2)* | `organization` | 1,00 | `canonical_form` : PSG<br>`entity_group` : g1<br>`mention_type` : name |
192
+ | PSG *(n°1)* | `loc_org` | 1,00 | `canonical_form` : PSG<br>`entity_group` : g1<br>`family` : organization<br>`mention_type` : name |
193
+ | Parc des Princes | `location` | 1,00 | `canonical_form` : Parc des Princes<br>`entity_group` : g2<br>`family` : location<br>`mention_type` : name |
194
+ | PSG *(n°2)* | `organization` | 1,00 | `canonical_form` : PSG<br>`entity_group` : g1<br>`family` : organization<br>`mention_type` : name |
194
195
 
195
196
  <!-- /generated:example:label-families -->
196
197
 
@@ -217,7 +218,7 @@ Annotations en sortie :
217
218
 
218
219
  | Texte annoté | Label | Score | Propriétés |
219
220
  |---|---|---|---|
220
- | Emmanuel Macron | `person` | 1,00 | `canonical_form` : Emmanuel Macron<br>`entity_group` : g1<br>`mention_type` : name |
221
+ | Emmanuel Macron | `person` | 1,00 | `canonical_form` : Emmanuel Macron<br>`entity_group` : g1<br>`family` : person<br>`mention_type` : name |
221
222
  | Washington | `lieu` | 1,00 | — |
222
223
 
223
224
  <!-- /generated:example:labels -->
@@ -245,8 +246,8 @@ Annotations en sortie :
245
246
 
246
247
  | Texte annoté | Label | Score | Propriétés |
247
248
  |---|---|---|---|
248
- | Emmanuel Macron | `PER` | 1,00 | `canonical_form` : Emmanuel Macron<br>`entity_group` : g1<br>`mention_type` : name |
249
- | Macron | `PER` | 1,00 | `canonical_form` : Emmanuel Macron<br>`entity_group` : g1<br>`mention_type` : name |
249
+ | Emmanuel Macron | `PER` | 1,00 | `canonical_form` : Emmanuel Macron<br>`entity_group` : g1<br>`family` : person<br>`mention_type` : name |
250
+ | Macron | `PER` | 1,00 | `canonical_form` : Emmanuel Macron<br>`entity_group` : g1<br>`family` : person<br>`mention_type` : name |
250
251
 
251
252
  <!-- /generated:example:person-family -->
252
253
 
@@ -1,3 +1,3 @@
1
1
  """Processor grouping the mentions of the same entity"""
2
2
 
3
- __version__ = "1.6.22"
3
+ __version__ = "1.6.26"
@@ -15,6 +15,9 @@ DEFAULT_HONORIFICS = ["M.", "MM.", "Mme", "Mmes", "Mlle", "Mlles", "Me", "Dr", "
15
15
  ENTITY_GROUP = "entity_group"
16
16
  CANONICAL_FORM = "canonical_form"
17
17
  MENTION_TYPE = "mention_type"
18
+ # The label family, by name (location for afplocation, person_family for the person labels):
19
+ # the linking step may map a family instead of each of its labels.
20
+ FAMILY = "family"
18
21
  # Only on an ambiguous partial name: the groups it may belong to.
19
22
  ENTITY_GROUP_CANDIDATES = "entity_group_candidates"
20
23
 
@@ -39,16 +42,16 @@ class CoreferenceParameters(ProcessorParameters):
39
42
  label_families: dict[str, str] | None = Field(
40
43
  None,
41
44
  description="""Families of labels grouped as one: each label is mapped to its family, and the labels mapped to the same family
42
- are grouped together. The family is another label (loc_org → organization) or any name (loc_org → 1, organization → 1).<br/>
45
+ are grouped together. The family is another label (loc_org → organization), whose name the linking step may map.<br/>
43
46
  A label not declared here belongs to the family of the shortest label that ends its name (afplocation with location).""",
44
- json_schema_extra={"extra": "key:label"},
47
+ json_schema_extra={"extra": "key:label,val:label"},
45
48
  )
46
49
  person_family: str = Field(
47
50
  "person",
48
51
  description="""Family of person names: its labels are grouped together (person and afpperson mentions),
49
52
  and a partial name ("Macron") joins the full name it ends ("Emmanuel Macron").<br/>
50
53
  A label of another name joins it through Label Families (PER → person).""",
51
- json_schema_extra={"extra": "advanced"},
54
+ json_schema_extra={"extra": "label,advanced"},
52
55
  )
53
56
  honorifics: list[str] = Field(
54
57
  DEFAULT_HONORIFICS,
@@ -142,6 +145,7 @@ def group_document(document: Document, params: CoreferenceParameters, honorifics
142
145
  properties[ENTITY_GROUP] = group_id[r]
143
146
  properties[CANONICAL_FORM] = canonical[r]
144
147
  properties[MENTION_TYPE] = "name"
148
+ properties[FAMILY] = params.person_family.strip().casefold() if r[0] == PERSON_FAMILY else r[0]
145
149
  if key in ambiguous:
146
150
  properties[ENTITY_GROUP_CANDIDATES] = sorted((group_id[c] for c in ambiguous[key]), key=lambda g: int(g[1:]))
147
151
  else: