Create README.md
Browse files
README.md
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
base_model:
|
| 3 |
+
- unsloth/Qwen3-14B-unsloth-bnb-4bit
|
| 4 |
+
---
|
| 5 |
+
|
| 6 |
+
This fine-tuned LLM is intended for the task of geocoding complex location references, and accompanies [Coordinates from Context: Using LLMs to Ground Complex Location References](https://arxiv.org/pdf/2510.08741) (Masis & O'Connor, EACL 2026).
|
| 7 |
+
|
| 8 |
+
### Model description
|
| 9 |
+
The base model is a quantized Qwen3-14B model (```unsloth/Qwen3-14B-unsloth-bnb-4bit```), which has been fine-tuned for geocoding, i.e. linking a location reference to an actual geographic location.
|
| 10 |
+
The model was trained using parameter-efficient fine-tuning via low-rank adaptation.
|
| 11 |
+
It was trained for our 'Geoparser-augmented' approach, where a separate geoparsing tool augments the inputs with the center coordinates of mentioned locations;
|
| 12 |
+
our fine-tuned model then uses both the original location reference and the mentioned locations' coordinates to generate the described location's bounding box.
|
| 13 |
+
For more details, please see the accompanying paper.
|
| 14 |
+
|
| 15 |
+
### Training data
|
| 16 |
+
The model is trained on 13k examples from the training subset of the [GeoCoDe dataset](https://github.com/EgoLaparra/geocode-data), where the input is a complex location reference and the center coordinates of each mentioned location and the output is the location's corresponding bounding box.
|
| 17 |
+
|
| 18 |
+
### Intended uses and limitations
|
| 19 |
+
Due to data limitations, this model has been trained and evaluated for our task only in Mainstream American English.
|
| 20 |
+
|
| 21 |
+
|
| 22 |
+
### Usage
|
| 23 |
+
We have included sample code below to use the model. For the system prompt and example prompts, please see the appendices in the accompanying paper.
|
| 24 |
+
|
| 25 |
+
```
|
| 26 |
+
from unsloth import FastLanguageModel
|
| 27 |
+
import torch
|
| 28 |
+
|
| 29 |
+
# Load model from Huggingface Hub
|
| 30 |
+
model, tokenizer = FastLanguageModel.from_pretrained(
|
| 31 |
+
model_name = "tmasis/geocoding-complex-location-references",
|
| 32 |
+
max_seq_length = 2048,
|
| 33 |
+
load_in_4bit = True)
|
| 34 |
+
FastLanguageModel.for_inference(model)
|
| 35 |
+
|
| 36 |
+
messages = [{"role": "system", "content": <system_prompt>},
|
| 37 |
+
{"role": "user", "content": <prompt>}]
|
| 38 |
+
text = tokenizer.apply_chat_template(messages, tokenizer=False,
|
| 39 |
+
add_generation_prompt = True, enable_thinking = False)
|
| 40 |
+
outputs = model.generate(**tokenizer(text, return_tensors="pt").to("cuda"),
|
| 41 |
+
max_new_tokens=1024, temperature=0.7, top_p=0.8, top_k=20)
|
| 42 |
+
response = tokenizer.batch_decode(outputs)[0]
|
| 43 |
+
```
|