Views
No views yet
ville, la rivière, royaume.France, Paris, la Chine.ville de France, royaume de Naples, la mer Baltique.dans, sur, à 10 lieues de.Long. 19. 49. lat. 43. 55. 44.roi, l'empereur, les auteurs.Louis XIV, Pline, les Romains.le czar Pierre, roi de Macédoinel'Eglise, 1702, Pélasgique.l'ordre de S. Jacques, la déclaration du 21 Mars 1671.Géographie, Geog., en Anatomie.>=3.7.2,<3.8.0tok2vec, spancat1
2pip install "fr_spacy_custom_spancat_edda @ https://huggingface.co/GEODE/fr_spacy_custom_spancat_edda/resolve/main/fr_spacy_custom_spancat_edda-any-py3-none-any.whl"1# Using spacy.load().
2import spacy
3nlp = spacy.load("fr_spacy_custom_spancat_edda")
4
5# Importing as module.
6import fr_spacy_custom_spancat_edda
7nlp = fr_spacy_custom_spancat_edda.load()
8doc = nlp("* ALBI, (Géog.) ville de France, capitale de l'Albigeois, dans le haut Languedoc : elle est sur le Tarn. Long. 19. 49. lat. 43. 55. 44.")
9
10spans = []
11
12for span in doc.spans['sc']:
13 spans.append({
14 "start": span.start_char,
15 "end": span.end_char,
16 "labels": [span.label_],
17 "text": span.text
18 })
19
20print(spans)
21
22# Output
23[{'start': 2, 'end': 6, 'labels': ['Head'], 'text': 'ALBI'},
24 {'start': 16, 'end': 21, 'labels': ['NC-Spatial'], 'text': 'ville'},
25 {'start': 25, 'end': 31, 'labels': ['NP-Spatial'], 'text': 'France'},
26 {'start': 33, 'end': 41, 'labels': ['NC-Spatial'], 'text': 'capitale'},
27 {'start': 58, 'end': 62, 'labels': ['Relation'], 'text': 'dans'},
28 {'start': 92, 'end': 95, 'labels': ['Relation'], 'text': 'sur'},
29 {'start': 9, 'end': 14, 'labels': ['Domain-mark'], 'text': 'Géog.'},
30 {'start': 45, 'end': 56, 'labels': ['NP-Spatial'], 'text': "l'Albigeois"},
31 {'start': 96, 'end': 103, 'labels': ['NP-Spatial'], 'text': 'le Tarn'},
32 {'start': 16,
33 'end': 31,
34 'labels': ['ENE-Spatial'],
35 'text': 'ville de France'},
36 {'start': 63,
37 'end': 80,
38 'labels': ['NP-Spatial'],
39 'text': 'le haut Languedoc'},
40 {'start': 33,
41 'end': 56,
42 'labels': ['ENE-Spatial'],
43 'text': "capitale de l'Albigeois"},
44 {'start': 33,
45 'end': 80,
46 'labels': ['ENE-Spatial'],
47 'text': "capitale de l'Albigeois, dans le haut Languedoc"},
48 {'start': 16,
49 'end': 80,
50 'labels': ['ENE-Spatial'],
51 'text': "ville de France, capitale de l'Albigeois, dans le haut Languedoc"}]| Knowledge domain | Paragraphs |
|---|---|
| Géographie | 1096 |
| Histoire | 259 |
| Droit Jurisprudence | 113 |
| Physique | 92 |
| Métiers | 92 |
| Médecine | 88 |
| Philosophie | 69 |
| Histoire naturelle | 65 |
| Belles-lettres | 65 |
| Militaire | 62 |
| Commerce | 48 |
| Beaux-arts | 44 |
| Agriculture | 36 |
| Chasse | 31 |
| Religion | 23 |
| Musique | 17 |
| Train | Validation | Test | |
|---|---|---|---|
| Paragraphs | 1,800 | 200 | 200 |
| Tokens | 132,398 | 14,959 | 13,881 |
| NC-Spatial | 3,252 | 358 | 355 |
| NP-Spatial | 4,707 | 464 | 519 |
| ENE-Spatial | 3,043 | 326 | 334 |
| Relation | 2,093 | 219 | 226 |
| Latlong | 553 | 66 | 72 |
| NC-Person | 1,378 | 132 | 133 |
| NP-Person | 1,599 | 170 | 150 |
| ENE-Person | 492 | 49 | 57 |
| NP-Misc | 948 | 108 | 96 |
| ENE-Misc | 255 | 31 | 22 |
| Head | 1,261 | 142 | 153 |
| Domain-Mark | 1,069 | 122 | 133 |
| Precision | Recall | F-score | |
|---|---|---|---|
| 94.09 | 79.91 | 86.42 |
| Precision | Recall | F-score | |
|---|---|---|---|
| NC-Spatial | 96.50 | 93.24 | 94.84 |
| NP-Spatial | 92.74 | 95.95 | 94.32 |
| ENE-Spatial | 91.67 | 95.51 | 93.55 |
| Relation | 97.33 | 64.60 | 77.66 |
| Latlong | 0.00 | 0.00 | 0.00 |
| NC-Person | 93.07 | 70.68 | 80.34 |
| NP-Person | 92.47 | 90.00 | 91.22 |
| ENE-Person | 92.16 | 82.46 | 87.04 |
| NP-Misc | 93.24 | 71.88 | 81.18 |
| ENE-Misc | 0.00 | 0.00 | 0.00 |
| Head | 97.37 | 24.18 | 38.74 |
| Domain-mark | 99.19 | 91.73 | 95.31 |
Moncla, L., Vigier, D., & McDonough, K. (2024). GeoEDdA: A Gold Standard Dataset for Geo-semantic Annotation of Diderot & d’Alembert’s Encyclopédie. In proceedings of the 2nd International Workshop on Geographic Information Extraction from Texts (GeoExT'24), ECIR Conference, Glasgow, UK.