Views
No views yet
toponym-19thC-en is a BERT model fine-tuned for the task toponym recognition on the TopRes19th dataset. It has been trained to recognise the following types of entities: LOC, BUILDING, and STREET, particularly in digitised 19th-century newspaper texts in English.toponym-19thC-en uses the Livingwithmachines/bert_1760_1900 BERT model as base (which is a bert-base-uncased model) fine-tuned on a large historical dataset of books in English, published between 1760-1900 and comprised of ~5.1 billion tokens.LOC, BUILDING, and STREET.1>>> from transformers import pipeline
2>>> model = "Livingwithmachines/toponym-19thC-en"
3>>> ner_pipe = pipeline("ner", model=model)
4>>> results = ner_pipe("MANUFACTURED ONLY AT 7S, NEW OXFORD-STREET, LONDON.")
5
6[
7 {'entity': 'B-STREET', 'score': 0.99885094, 'index': 7, 'word': 'new', 'start': 25, 'end': 28},
8 {'entity': 'I-STREET', 'score': 0.9906386, 'index': 8, 'word': 'oxford', 'start': 29, 'end': 35},
9 {'entity': 'I-STREET', 'score': 0.9944792, 'index': 9, 'word': '-', 'start': 35, 'end': 36},
10 {'entity': 'I-STREET', 'score': 0.9945181, 'index': 10, 'word': 'street', 'start': 36, 'end': 42},
11 {'entity': 'B-LOC', 'score': 0.9986091, 'index': 12, 'word': 'london', 'start': 44, 'end': 50}
12]1>>> from transformers import pipeline
2>>> model = "Livingwithmachines/toponym-19thC-en"
3>>> ner_pipe = pipeline("ner", model=model, aggregation_strategy="average")
4>>> results = ner_pipe("MANUFACTURED ONLY AT 7S, NEW OXFORD-STREET, LONDON.")
5
6[
7 {'entity_group': 'STREET', 'score': 0.9946217, 'word': 'new oxford - street', 'start': 25, 'end': 42},
8 {'entity_group': 'LOC', 'score': 0.9986091, 'word': 'london', 'start': 44, 'end': 50}
9]O describes a token that does not belong to a named entity, a tag prefixed B- indicates that it corresponds to the first token in the named entity, while a tag prefixed I- indicates that the corresponding token is part of a named entity.BUILDING for buildings,STREET for streets, roads, and other odonyms,LOC for any other real world places regardless of type or scale,ALIEN for extraterrestrial locations, such as 'Venus'.FICTION for fictional or mythical places, such as 'Hell', andOTHER for other types of entities with coordinates, such as events, like the 'Battle of Waterloo'.ALIEN, FICTION and OTHER named entities were found to occur between zero and five times in the whole dataset, therefore resulting negligible for training purposes.Livingwithmachines/bert_1760_1900, which is fine-tuned on a historical dataset of digitised books in English, published between 1760 and 1900, including both fiction and non-fiction. Therefore, the model's predictions have to be understood in their historical context. Furthermore, despite the size of the dataset (ca. 48,000 books and 5.1 billion words), this dataset is not representative of nineteenth-century English, but only of (some of) those authors who had the option to publish a book. It therefore needs to be used with caution. You can find more information about the original dataset here, or read more about the base model in this paper.["Ashton", "-", "under", "-", "Lyne"]), which is tagged as ["B-LOC", "B-LOC", "B-LOC", "B-LOC", "B-LOC"], instead of ["B-LOC", "I-LOC", "I-LOC", "I-LOC", "I-LOC"]. An imperfect solution is to apply a post-processing step in which the tag prefix is changed to "I-" when the current token or the previous token is a hyphen, and the entity type of both previous and current token is the same and not"O".Coll Ardanuy, Mariona, David Beavan, Kaspar Beelen, Kasra Hosseini, Jon Lawrence, Katherine McDonough, Federico Nanni, Daniel van Strien, and Daniel C. S. Wilson. 2022. “A Dataset for Toponym Resolution in Nineteenth-century English Newspapers”. Journal of Open Humanities Data 8 (0): 3. DOI: https://doi.org/10.5334/johd.56Hosseini, Kasra, Beelen, Kaspar, Colavizza, Giovanni and Coll Ardanuy, Mariona, 2021. Neural Language Models for Nineteenth-Century English. Journal of Open Humanities Data, 7(0), p.22. DOI: https://doi.org/10.5334/johd.48