File size: 6,346 Bytes
8fdee0c fec9757 de9c148 fec9757 6aafa6a ae364e6 8fdee0c ad25ac5 8fdee0c 8b80762 8fdee0c 313e278 8b80762 8fdee0c e448c1c 8fdee0c 15e5d5a 8fdee0c e448c1c 8fdee0c 4ea2c35 4482204 e448c1c 8fdee0c e448c1c 8fdee0c e448c1c 8fdee0c e448c1c 8fdee0c e448c1c 73d9f92 e448c1c 8fdee0c e448c1c 8fdee0c e448c1c b53f2be e448c1c 4ea2c35 e448c1c 8fdee0c 4ea2c35 e448c1c 8fdee0c e448c1c 8fdee0c e448c1c 8fdee0c e448c1c 8fdee0c e448c1c 8fdee0c 8b80762 8fdee0c |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 |
---
language:
- en
thumbnail: url to a thumbnail used in social sharing
tags:
- toponym detection
- language model
- geospatial understanding
- geolm
license: cc-by-nc-2.0
datasets:
- GeoWebNews
metrics:
- f1
pipeline_tag: token-classification
widget:
- text: >-
Minneapolis, officially the City of Minneapolis, is a city in the state of Minnesota
and the county seat of Hennepin County. As of the 2020 census the population was
429,954, making it the largest city in Minnesota and the 46th-most-populous in the
United States. Nicknamed the "City of Lakes", Minneapolis is abundant in water,
with thirteen lakes, wetlands, the Mississippi River, creeks, and waterfalls.
- text: >-
Los Angeles, often referred to by its initials L.A., is the most populous
city in California, the most populous U.S. state. It is the commercial, financial,
and cultural center of Southern California. Los Angeles is the second-most populous
city in the United States after New York City, with a population of roughly 3.9
million residents within the city limits as of 2020.
---
# Model Card for GeoLM model for Toponym Recognition
<!-- Provide a quick summary of what the model is/does. [Optional] -->
A language model for detecting toponyms (i.e. place names) from sentences. We pretrain the GeoLM model on world-wide OpenStreetMap (OSM), WikiData and Wikipedia data, then fine-tune it for Toponym Recognition task on GeoWebNews dataset
# Model Details
## Model Description
<!-- Provide a longer summary of what this model is/does. -->
Pretrain the GeoLM model on world-wide OpenStreetMap (OSM), WikiData and Wikipedia data, then fine-tune it for Toponym Recognition task on GeoWebNews dataset
<!--- **Developed by:** UMN Knowledge Computing Lab & USC LUKA Lab -->
- **Model type:** Language model for geospatial understanding
- **Language(s) (NLP):** en
- **License:** cc-by-nc-2.0
- **Parent Model:** https://huggingface.co/zekun-li/geolm-base-cased
<!---- **Resources for more information:** Zekun Li (li002666[Shift+2]umn.edu) -->
# Uses
<!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
This is a fine-tuned GeoLM model for toponym detection task. The inputs are sentences and outputs are detected toponyms.
<!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
<!-- If the user enters content, print that. If not, but they enter a task in the list, use that. If neither, say "more info needed." -->
To use this model, please refer to the code below.
* **Option 1:** Load weights to a BERT model (Same procedure as the demo on the right side panel)
```python
import torch
from transformers import AutoModelForTokenClassification, AutoTokenizer
# Model name from Hugging Face model hub
model_name = "zekun-li/geolm-base-toponym-recognition"
# Load tokenizer and model
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForTokenClassification.from_pretrained(model_name)
# Example input sentence
input_sentence = "Minneapolis, officially the City of Minneapolis, is a city in the state of Minnesota and the county seat of Hennepin County."
# Tokenize input sentence
tokens = tokenizer.encode(input_sentence, return_tensors="pt")
# Pass tokens through the model
outputs = model(tokens)
# Retrieve predicted labels for each token
predicted_labels = torch.argmax(outputs.logits, dim=2)
predicted_labels = predicted_labels.detach().cpu().numpy()
# Decode predicted labels
predicted_labels = [model.config.id2label[label] for label in predicted_labels[0]]
# Print predicted labels
print(predicted_labels)
# ['O', 'B-Topo', 'O', 'O', 'O', 'O', 'O', 'B-Topo', 'O', 'O', 'O', 'O', 'O', 'O',
# 'O', 'O', 'B-Topo', 'O', 'O', 'O', 'O', 'O', 'B-Topo', 'I-Topo', 'I-Topo', 'O', 'O', 'O']
```
* **Option 2:** Load weights to a GeoLM model
To appear soon
# 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. -->
**GeoWebNews** (Credit to [Gritta et al.](https://arxiv.org/pdf/1810.12368.pdf))
Download link: https://github.com/milangritta/Pragmatic-Guide-to-Geoparsing-Evaluation/blob/master/data/GWN.xml
## Training Procedure
<!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
### Speeds, Sizes, Times
<!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
More information needed
# Evaluation
<!-- This section describes the evaluation protocols and provides the results. -->
## Testing Data & Metrics & Results
### Testing Data
<!-- This should link to a Data Card if possible. -->
More information needed
### Metrics
<!-- These are the evaluation metrics being used, ideally with a description of why. -->
More information needed
### Results
More information needed
# Technical Specifications [optional]
## Model Architecture and Objective
More information needed
## Compute Infrastructure
More information needed
# Bias, Risks, and Limitations
<!-- This section is meant to convey both technical and sociotechnical limitations. -->
Significant research has explored bias and fairness issues with language models (see, e.g., [Sheng et al. (2021)](https://aclanthology.org/2021.acl-long.330.pdf) and [Bender et al. (2021)](https://dl.acm.org/doi/pdf/10.1145/3442188.3445922)). Predictions generated by the model may include disturbing and harmful stereotypes across protected classes; identity characteristics; and sensitive, social, and occupational groups.
# Citation
<!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
**BibTeX:**
More information needed
**APA:**
More information needed
# Model Card Author [optional]
<!-- This section provides another layer of transparency and accountability. Whose views is this model card representing? How many voices were included in its construction? Etc. -->
<!--- Zekun Li (li002666[Shift+2]umn.edu) -->
|