Fine-tuned mDeBERTa-v3-base that tags place spans (CITY / COUNTRY / ENTITY, typed BIO)
in travel text across 13 languages, plus a parameter-free linker + gazetteer that turns
each span into a structured record. v3 adds region support and a structured output schema;
v2 remains available in the companion *-13lang / *-onnx / *-tagger repos.
{type, text, city, region, country, query}:
type includes REGION; cities are enriched with their admin-1 region (Florence→Tuscany);
query is the flat "<entity> <city> <country>" string (unchanged, backward-compatible).compose_structural_query(..., coherence_vote=True))
but is off by default pending further validation.import json
from infer_place_extractor import PlaceExtractor # scripts/
ext = PlaceExtractor("model",
region_names=set(json.load(open("gazetteer/region_names.json"))),
city_region=json.load(open("gazetteer/city_region.json")))
gaz = json.load(open("gazetteer/city_country_gazetteer.json"))["case_insensitive"]
gaz_multi = json.load(open("gazetteer/city_country_multi.json"))
for e in ext.extract("A week in Tuscany, then Florence and Rome", gaz, gazetteer_multi=gaz_multi):
print(e["type"], e["text"], "->", e["region"], e["country"])
The model alone (token classification) also loads with the standard transformers pipeline;
the gazetteer + scripts/ add the linking, region typing, and enrichment.
model/ — DebertaV2ForTokenClassification (7 BIO tags) + tokenizer + bio_head.pt.gazetteer/ — city_country_gazetteer.json (name→country), city_country_multi.json
(ambiguous names, [country, language-editions, population]), region_names.json
(names typed REGION), city_region.json (city→admin-1 region).scripts/ — infer_place_extractor.py + _gen_common.py (the parameter-free linker, region
typing, enrichment, and compose).Trained on public-data synthetic travel text generated from GeoNames (CC-BY) and Wikidata (CC0), balanced across the 13 languages with native scripts for the non-Latin ones. Released MIT.
Have the files? Publish a torrent.
Publish a torrentHave the complete files and permission to share them? Replace the example folder path. The script checks the files, makes a torrent and submits its magnet and checksums. Keep your torrent client seeding. Get your community key from your settings, and read the script before running it.
curl -fsSL https://pirateface.co/package.sh | bash -s -- --repo Berk/multilingual-place-extractor-mdeberta-13lang-onnx-v3 ./model-folderonnx/model.onnx 1.0 GiBonnx/model_fp16.onnx 532 MiB