Token Classification
Transformers
PyTorch
Safetensors
English
bert
toponym detection
language model
geospatial understanding
geolm
Instructions to use knowledge-computing/geolm-base-toponym-recognition with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use knowledge-computing/geolm-base-toponym-recognition with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("token-classification", model="knowledge-computing/geolm-base-toponym-recognition")# Load model directly from transformers import AutoTokenizer, AutoModelForTokenClassification tokenizer = AutoTokenizer.from_pretrained("knowledge-computing/geolm-base-toponym-recognition") model = AutoModelForTokenClassification.from_pretrained("knowledge-computing/geolm-base-toponym-recognition", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Upload README.md
Browse files
README.md
CHANGED
|
@@ -90,7 +90,8 @@ This is a fine-tuned GeoLM model for toponym detection task. The inputs are sent
|
|
| 90 |
|
| 91 |
To use this model, please refer to the code below.
|
| 92 |
|
| 93 |
-
* Option 1: Load weights to a BERT model (Same procedure as the demo on the right side panel)
|
|
|
|
| 94 |
```import torch
|
| 95 |
from transformers import AutoModelForTokenClassification, AutoTokenizer
|
| 96 |
|
|
@@ -122,7 +123,7 @@ predicted_labels = [model.config.id2label[label] for label in predicted_labels[0
|
|
| 122 |
# Print predicted labels
|
| 123 |
print(predicted_labels)
|
| 124 |
```
|
| 125 |
-
* Option 2: Load weights to a GeoLM model
|
| 126 |
|
| 127 |
To appear soon
|
| 128 |
|
|
@@ -133,7 +134,8 @@ To appear soon
|
|
| 133 |
|
| 134 |
<!-- 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. -->
|
| 135 |
|
| 136 |
-
GeoWebNews (Credit to Gritta et al.)
|
|
|
|
| 137 |
Download link: https://github.com/milangritta/Pragmatic-Guide-to-Geoparsing-Evaluation/blob/master/data/GWN.xml
|
| 138 |
|
| 139 |
## Training Procedure
|
|
|
|
| 90 |
|
| 91 |
To use this model, please refer to the code below.
|
| 92 |
|
| 93 |
+
* **Option 1:** Load weights to a BERT model (Same procedure as the demo on the right side panel)
|
| 94 |
+
|
| 95 |
```import torch
|
| 96 |
from transformers import AutoModelForTokenClassification, AutoTokenizer
|
| 97 |
|
|
|
|
| 123 |
# Print predicted labels
|
| 124 |
print(predicted_labels)
|
| 125 |
```
|
| 126 |
+
* **Option 2:** Load weights to a GeoLM model
|
| 127 |
|
| 128 |
To appear soon
|
| 129 |
|
|
|
|
| 134 |
|
| 135 |
<!-- 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. -->
|
| 136 |
|
| 137 |
+
**GeoWebNews** (Credit to [Gritta et al.](https://arxiv.org/pdf/1810.12368.pdf))
|
| 138 |
+
|
| 139 |
Download link: https://github.com/milangritta/Pragmatic-Guide-to-Geoparsing-Evaluation/blob/master/data/GWN.xml
|
| 140 |
|
| 141 |
## Training Procedure
|