CoolFace
Modelpublic

GEODE/bert-base-multilingual-cased-place-entry-classification

sourceHugging Facecc-by-nc-4.0updated 1y agoView on Hugging Face
0likes9downloads
Model Card

bert-base-multilingual-cased-place-entry-classification

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

This model is designed to classify geographic encyclopedia articles describing places. It is a fine-tuned version of the bert-base-multilingual-cased model. It has been trained on GeoEDdA-TopoRel, a manually annotated subset of 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).

Model Description

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

Class labels

The tagset is as follows (with examples from the dataset):

  • City: villes, bourgs, villages, etc.
  • Island: îles, presqu'îles, etc.
  • Region: régions, contrées, provinces, cercles, etc.
  • River: rivières, fleuves,etc.
  • Mountain: montagnes, vallées, etc.
  • Country: pays, royaumes, etc.
  • Sea: mer, golphe, baie, etc.
  • Other: promontoires, caps, rivages, déserts, etc.
  • Human-made: ports, châteaux, forteresses, abbayes, etc.
  • Lake: lacs, étangs, marais, etc.

Dataset

The model was trained using the GeoEDdA-TopoRel dataset. The dataset is splitted into train, validation and test sets which have the following distribution of entries among classes:

TrainValidationTest
City9213340
Island2162027
Region1384028
River1332028
Mountain632922
Human-made38109
Other271212
Sea261312
Lake2299
Country161413

Evaluation

  • Overall macro-average model performances
PrecisionRecallF-score
0.950.920.93
  • Overall weighted-average model performances
PrecisionRecallF-score
0.940.940.94
  • Model performances (Test set)
PrecisionRecallF-scoreSupport
City0.911.000.9540
Island0.960.960.9627
River0.971.000.9828
Region0.860.890.8828
Mountain1.000.950.9822
Country1.000.850.9213
Sea1.000.920.9612
Other0.900.750.8212
Human-made0.901.000.959
Lake1.000.890.949

How to Get Started with the Model

Use the code below to get started with the model.

python
import torch
from transformers import pipeline, AutoTokenizer, AutoModelForSequenceClassification
device = torch.device("mps" if torch.backends.mps.is_available() else ("cuda" if torch.cuda.is_available() else "cpu"))

tokenizer = AutoTokenizer.from_pretrained("GEODE/bert-base-multilingual-cased-place-entry-classification")
model = AutoModelForSequenceClassification.from_pretrained("GEODE/bert-base-multilingual-cased-place-entry-classification")

pipe = pipeline("text-classification", model=model, tokenizer=tokenizer, truncation=True, device=device)

samples = [
    "* 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.",
    "* ARCALU (Principauté d') petit état des Tartares-Monguls, sur la riviere d'Hoamko, où commence  la grande muraille de la Chine, sous le 122e degré de longitude & le 42e de latitude septentrionale."
]


for sample in samples:
    print(pipe(sample))


# Output

[{'label': 'City', 'score': 0.9969543218612671}]
[{'label': 'Region', 'score': 0.9811353087425232}]

Bias, Risks, and Limitations

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

This model was trained entirely on French encyclopaedic entries classified as Geography (and place) and will likely not perform well on text in other languages or other corpora.

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.