Araya2001 commited on
Commit
9d35c41
·
verified ·
1 Parent(s): 45ee2ea

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +107 -0
README.md ADDED
@@ -0,0 +1,107 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ language:
4
+ - es
5
+ base_model: Qwen/Qwen3-4B-Instruct-2507
6
+ pipeline_tag: text-generation
7
+ library_name: transformers
8
+ tags:
9
+ - address-parsing
10
+ - structured-output
11
+ - costa-rica
12
+ - geocoding
13
+ - qwen3
14
+ ---
15
+
16
+ # tac-1 — Costa Rican reference-point address parser
17
+
18
+ ## What is tac-1
19
+
20
+ Costa Rica has no street-address system. Addresses are reference-point narratives — "del antiguo higuerón de San Pedro, 100 metros sur" or "de la esquina noroeste del Mercado Central, 200 metros norte, casa esquinera." tac-1 parses these into a structured, leg-based JSON record. It performs **parsing only**: geometry (resolving the anchor point to coordinates and walking the OSM street graph along each leg) belongs to the deterministic grounder in the tico-address repo (`https://github.com/CodeStrux/tac-1`).
21
+
22
+ ## Architecture
23
+
24
+ tac-1 is a hybrid system. This model extracts the structured address fields (anchor name, anchor type, and a list of legs with direction and distance). The `tico` package then grounds the parse by walking the OSM street graph — it resolves the anchor to a coordinate via `resolve_anchor`, then traces each leg along the graph using the same geometry core that generated the training data. See `https://github.com/CodeStrux/tac-1` for the full grounder implementation.
25
+
26
+ ## Evaluation
27
+
28
+ ### gold-47 vs teacher
29
+
30
+ | metric | tac-1 (bf16) | tac-1 (FP8) | teacher gpt-4.1 |
31
+ |---|---|---|---|
32
+ | parse rate | 1.000 | 1.000 | 1.000 |
33
+ | anchor_name F1 | 0.979 | 0.979 | 0.872 |
34
+ | direction F1 | 0.995 | 0.984 | 1.000 |
35
+ | distance F1 | 0.995 | 0.984 | 1.000 |
36
+ | perfect-anchor ≤250 m | 93.6% | 93.6% | 93.6% |
37
+ | perfect-anchor median | 0.0 m | 0.0 m | 0.0 m |
38
+ | gazetteer ≤250 m | 80.9% | 80.9% | 83.0% |
39
+
40
+ **Headline:** anchor_name F1 beats the gpt-4.1 teacher, with zero geographic overfit on never-trained districts.
41
+
42
+ ### heldout-805
43
+
44
+ | metric | tac-1 (bf16) |
45
+ |---|---|
46
+ | parse rate | 1.000 |
47
+ | anchor_name F1 | 1.000 |
48
+ | direction F1 | 1.000 |
49
+ | distance F1 | 1.000 |
50
+ | perfect-anchor median | 89.5 m |
51
+ | perfect-anchor ≤250 m | 81.0% |
52
+ | gazetteer median | 148.8 m |
53
+ | gazetteer ≤250 m | 65.0% |
54
+
55
+ Grounding-baseline medians on heldout-805: hybrid_walk 143.8 m vs calibrated_project 198.7 m vs naive_project 201.9 m (the graph walk beats projection on unseen geography).
56
+
57
+ The three never-trained districts (grecia, curridabat, go-guadalupe) show anchor_name/direction/distance F1 all at 1.000 — zero geographic overfit.
58
+
59
+ ## Quickstart
60
+
61
+ ```bash
62
+ vllm serve CodeStrux-Tech/tac-1 --served-model-name tac-1 --max-model-len 4096
63
+ # On hosts without nvcc, disable the FlashInfer sampler JIT:
64
+ # VLLM_USE_FLASHINFER_SAMPLER=0 vllm serve ...
65
+ ```
66
+
67
+ ```python
68
+ from tico.extractor.clients.vllm import VLLMExtractor
69
+
70
+ extractor = VLLMExtractor() # VLLM_BASE_URL=http://localhost:8000/v1, TICO_VLLM_MODEL=tac-1
71
+ addr = extractor.extract("del antiguo higuerón de San Pedro, 100 metros sur")
72
+ print(addr.model_dump_json(indent=2))
73
+ ```
74
+
75
+ ## Limitations
76
+
77
+ - **confidence is a constant 0.0** — uncalibrated; do not consume this value.
78
+ - **anchor lat/lon/osm_id are always null by design** — coordinates belong to the grounder's `resolve_anchor`, not the model.
79
+ - **Spanish/Costa-Rica-specific** — the model was trained and evaluated exclusively on Costa Rican Spanish reference-point addresses.
80
+ - **Remaining system headroom is gazetteer/calibration coverage, not the model** — the extractor is at or near ceiling on the evaluation sets; further accuracy gains require broader OSM ingestion and calibration.
81
+
82
+ ## Training
83
+
84
+ - **Base model:** Qwen/Qwen3-4B-Instruct-2507
85
+ - **Method:** QLoRA (r=16, α=32)
86
+ - **Learning rate:** 2e-4
87
+ - **Epochs:** 2
88
+ - **Max sequence length:** 4096
89
+ - **Steps:** 692
90
+ - **Final train loss:** 0.043
91
+ - **Hardware:** ~2 h 50 m on an RTX 4080 16 GB
92
+ - **Stack:** unsloth 2025.11.1 / transformers 4.57.2 / trl 0.23.0
93
+ - **Corpus:** `CodeStrux-Tech/tac-1-corpus` — 5,532 train examples (seed 0), 805 heldout examples (seed 1); `--max-legs 4`; 22 districts ingested, 19,042 POIs, 11 griddable; holdout districts grecia, curridabat, go-guadalupe excluded from training.
94
+
95
+ ### Training data attribution
96
+
97
+ Contains information from OpenStreetMap (https://www.openstreetmap.org/copyright), which is made available under the Open Database License (ODbL) 1.0. © OpenStreetMap contributors.
98
+
99
+ **Licensing.** The tac-1 corpus is a derivative database of OpenStreetMap and is released under the Open Database License (ODbL) 1.0, with attribution: © OpenStreetMap contributors (https://www.openstreetmap.org/copyright). The tac-1 model weights are a produced work trained on that corpus and are released under Apache-2.0; the corpus's ODbL provenance is disclosed in every model card. Code is Apache-2.0 (LICENSE); data is ODbL (DATA_LICENSE); see NOTICE. Sources are OpenStreetMap + INEC/IGN + community DTA tables only — no Google or Waze data anywhere in the pipeline, training data, or release.
100
+
101
+ ## Related
102
+
103
+ - [`CodeStrux-Tech/tac-1-fp8-dynamic`](https://huggingface.co/CodeStrux-Tech/tac-1-fp8-dynamic) — FP8 dynamic quantization
104
+ - [`CodeStrux-Tech/tac-1-gguf`](https://huggingface.co/CodeStrux-Tech/tac-1-gguf) — GGUF (Q5_K_M + f16) for llama.cpp / Ollama
105
+ - [`CodeStrux-Tech/tac-1-lora`](https://huggingface.co/CodeStrux-Tech/tac-1-lora) — QLoRA adapter weights
106
+ - [`CodeStrux-Tech/tac-1-corpus`](https://huggingface.co/CodeStrux-Tech/tac-1-corpus) — training corpus (ODbL)
107
+ - Source code: `https://github.com/CodeStrux/tac-1`