CoolFace
Modelpublic

GEODE/camembert-base-edda-span-classification

sourceHugging Facecc-by-nc-4.0updated 2y agoView on Hugging Face
0likes31downloads
Model Card

camembert-base-edda-span-classification

<!-- Provide a quick summary of what the model is/does. -->

This model is designed to identify and classify named entities (such as Spatial, Person, and MISC), nominal entities, spatial relations, and other relevant information such as geographic coordinates within French encyclopedic entries. It has been trained on the French Encyclopédie ou dictionnaire raisonné des sciences des arts et des métiers par une société de gens de lettres (1751-1772) edited by Diderot and d'Alembert (provided by the ARTFL Encyclopédie Project). Dataset: https://huggingface.co/datasets/GEODE/GeoEDdA

Class labels

<!-- Provide a list of tag detected by the model. -->

The tagset is as follows:

  • NC_Spatial: a common noun that identifies a spatial entity (nominal spatial entity) including natural features, e.g. ville, la rivière, royaume.
  • NP_Spatial: a proper noun identifying the name of a place (spatial named entities), e.g. France, Paris, la Chine.
  • Relation: spatial relation, e.g. dans, sur, à 10 lieues de.
  • Latlong: geographic coordinates, e.g. Long. 19. 49. lat. 43. 55. 44.
  • NC_Person: a common noun that identifies a person (nominal spatial entity), e.g. roi, l'empereur, les auteurs.
  • NP_Person: a proper noun identifying the name of a person (person named entities), e.g. Louis XIV, Pline, les Romains.
  • NP_Misc: a proper noun identifying entities not classified as spatial or person, e.g. l'Eglise, 1702, Pélasgique.
  • Head: entry name
  • Domain-Mark: words indicating the knowledge domain (usually after the head and between parenthesis), e.g. Géographie, Geog., en Anatomie.

Model Description

<!-- Provide a longer summary of what this model is. -->

Bias, Risks, and Limitations

<!-- This section is meant to convey both technical and sociotechnical limitations. -->

This model was trained entirely on French encyclopedic entries and will likely not perform well on text in other languages or other corpora.

How to Get Started with the Model

Use the code below to get started with the model.

python
from transformers import pipeline
import torch
from datasets import load_dataset


pipe = pipeline("token-classification", model="GEODE/camembert-base-edda-span-classification", aggregation_strategy="simple", device=device)

content = "* 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."

print(pipe(content))


# Output
[{'entity_group': 'Head',
  'score': 0.9918331,
  'word': 'ALBI',
  'start': 2,
  'end': 6},
 {'entity_group': 'Domain_mark',
  'score': 0.9260238,
  'word': '(Géog.',
  'start': 8,
  'end': 14},
 {'entity_group': 'NC_Spatial',
  'score': 0.99029493,
  'word': 'ville',
  'start': 16,
  'end': 21},
 {'entity_group': 'NP_Spatial',
  'score': 0.9919335,
  'word': 'France',
  'start': 25,
  'end': 31},
 {'entity_group': 'NC_Spatial',
  'score': 0.9903319,
  'word': 'capitale',
  'start': 33,
  'end': 41},
 {'entity_group': 'NP_Spatial',
  'score': 0.9919644,
  'word': "l'Albigeois",
  'start': 45,
  'end': 56},
 {'entity_group': 'Relation',
  'score': 0.98715705,
  'word': 'dans',
  'start': 58,
  'end': 62},
 {'entity_group': 'NP_Spatial',
  'score': 0.9919502,
  'word': 'le haut Languedoc',
  'start': 63,
  'end': 80},
 {'entity_group': 'Relation',
  'score': 0.98698694,
  'word': 'sur',
  'start': 92,
  'end': 95},
 {'entity_group': 'NP_Spatial',
  'score': 0.9921453,
  'word': 'le Tarn',
  'start': 96,
  'end': 103},
 {'entity_group': 'Latlong',
  'score': 0.99200517,
  'word': 'Long. 19. 49. lat. 43. 55. 44',
  'start': 105,
  'end': 134}]

Training Details

Training Data

<!-- This should link to a Data Card, perhaps with a short stub of information on what the training data is all about as well as documentation related to data pre-processing or additional filtering. -->

The model was trained using a set of 2200 paragraphs randomly selected out of 2001 Encyclopédie's entries. All paragraphs were written in French and are distributed as follows among the Encyclopédie knowledge domains:

Knowledge domainParagraphs
Géographie1096
Histoire259
Droit Jurisprudence113
Physique92
Métiers92
Médecine88
Philosophie69
Histoire naturelle65
Belles-lettres65
Militaire62
Commerce48
Beaux-arts44
Agriculture36
Chasse31
Religion23
Musique17

The spans/entities were labeled by the project team along with using pre-labelling with early models to speed up the labelling process. A train/val/test split was used. Validation and test sets are composed of 200 paragraphs each: 100 classified as 'Géographie' and 100 from another knowledge domain. The datasets have the following breakdown of tokens and spans/entities.

TrainValidationTest
Paragraphs1,800200200
Tokens132,39814,95913,881
NC-Spatial3,252358355
NP-Spatial4,707464519
Relation2,093219226
Latlong5536672
NC-Person1,378132133
NP-Person1,599170150
NP-Misc94810896
Head1,261142153
Domain-Mark1,069122133

Training Procedure

<!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->

For full training details and results please see the GitHub repository: https://github.com/GEODE-project/ner-bert

Evaluation

  • Overall micro-average model performances (token-based)
PrecisionRecallF-score
91.594.893.1
  • Token-based model performances (Test set)
PrecisionRecallF-scoreSupport
NC-Spatial96.795.195.9592
NP-Spatial95.995.595.7717
Relation89.895.692.6452
Latlong97.098.597.7789
NC-Person70.478.474.2222
NP-Person88.690.489.5198
NP-Misc69.082.975.3175
Head97.398.097.6254
Domain-mark99.0100.099.5392

Acknowledgement

The authors are grateful to the ASLAN project (ANR-10-LABX-0081) of the Université de Lyon, for its financial support within the French program "Investments for the Future" operated by the National Research Agency (ANR). Data courtesy the ARTFL Encyclopédie Project, University of Chicago.