Address matching by pair type: trained models
Trained weights of every neural run in the paper Address Matching by Pair Type: Segmented Classical Models versus Raw-String Neural Matchers (PDF): given two address strings, each model outputs a logit for "same location". Code (model definitions, training, the paper's tables): https://github.com/DZhang3210/address-matching-by-pair-type. Data: https://huggingface.co/datasets/zhangdav/address-matching-by-pair-type (config case2s).
These are the weights of the corrected version of the study. An earlier version was trained on data in which about 2% of the different-number non-matches had a house number on one side only; the pairs were rebuilt and every model retrained (paper, Appendix B). The earlier weights remain in this repository's commit history.
Runs
| Folder | Model | Seeds |
|---|---|---|
siamese/{mean,max}/seed_{0,1,2} |
Character-level siamese BiLSTM (char embedding 32 β BiLSTM 1 Γ 128 β mean or max pooling β head on `[ | uβv |
esim/{mc2,mc1,ft_mc1,rand_mc2,stack_mc1}/seed_{0,1,2} |
ESIM (frozen word vectors β BiLSTM 200 β soft alignment β BiLSTM 200 β mean + max β MLP 200). Settings: word2vec min_count 2 (mc2, the reproduction), word2vec min_count 1, fastText min_count 1 (ft_mc1, the kept setting), word2vec min_count 2 + a fixed random vector per rare word, [word2vec; fastText] stacked |
0, 1, 2 |
distilbert/bi/seed_{0,1,2} |
DistilBERT bi-encoder: each address alone, masked mean pooling, head on `[ | uβv |
distilbert/cross/seed_{0,1,2} |
DistilBERT cross-encoder: [CLS] A [SEP] B [SEP], masked mean + max pooling, MLP 200 |
0, 1, 2 |
Each folder holds model.safetensors (the state dict of the best epoch) and config.json (vocabulary for the siamese and ESIM models, settings, and the best epoch's validation numbers). ESIM's frozen embedding table is part of its state dict, so no word-vector files are needed. predictions/ has every run's validation/test probabilities, training histories and the rare-number group masks; the GitHub repo's results/paper_tables.ipynb reproduces the paper's tables from them.
All models were trained on the case2s train split with one protocol: binary cross-entropy, best epoch = most validation non-identical matches found among epochs that reject β₯ 98% of validation different-number pairs, early stopping. Threshold 0.5.
Results
Test set, % of each pair type classified correctly at 0.5, and the ROC AUC of non-identical matches against look-alike streets (paper, Table 15; minβmax over three seeds; XGBoost, not in this repository, for reference):
| Model | Identical found | Non-identical found | Different number rejected | Look-alike rejected | Random rejected | AUC, non-identical vs look-alike |
|---|---|---|---|---|---|---|
| n (pairs) | 3,543 | 843 | 14,379 | 1,053 | 24,019 | |
| XGBoost (sentinel) | 100 | 83.6 | 100.0 | 87.0 | 99.9 | 0.920 |
| Siamese BiLSTM, mean pooling | 100 | 87.0β89.3 | 99.9β100.0 | 69.8β73.1 | 99.5β99.8 | 0.878β0.893 |
| ESIM, fastText | 100 | 87.3β90.3 | 98.1β99.0 | 73.5β80.4 | 99.8β99.9 | 0.861β0.890 |
| DistilBERT bi-encoder | 100 | 89.0β90.9 | 99.8β99.9 | 57.6β68.8 | 99.8β99.9 | 0.883β0.893 |
| DistilBERT cross-encoder | 100 | 80.3β83.0 | 99.9β100.0 | 86.1β88.8 | 99.9 | 0.888β0.904 |
Usage
# from a clone of https://github.com/DZhang3210/address-matching-by-pair-type
import torch
from helpers.released import load_released
model, collate = load_released("distilbert", "cross", seed=0) # downloads that run from this repo
pairs = [("12 ELM ST", "12 ELM STREET", 1), ("431 HALLETT ST", "431 HARRIET ST", 0)]
batch = collate(pairs)
with torch.no_grad():
print(torch.sigmoid(model(*batch[:-1]))) # P(same location)
Limitations
Trained on Connecticut addresses only, at the building level (units ignored), with labels from Overture's own Overture β Foursquare matching. The neural models rank non-identical matches against look-alike streets about as well as the tree models once matches with a missing house number are set aside, but find only 63β76% of matches where one side has no house number, against 94β96% for the tree models. Not tested in a candidate-retrieval setting.
Data attribution
Trained on pairs built from Overture Maps Places (release 2026-09-23.1; CDLA Permissive 2.0 / Apache 2.0, see Overture attribution) and Foursquare Open Source Places (release 2026-09-15; Β© Foursquare Labs, Inc., Apache 2.0). The DistilBERT models are fine-tuned from distilbert-base-uncased (Apache 2.0).
Citation
@misc{zhang2026addressmatching,
author = {Zhang, David},
title = {Address Matching by Pair Type: Segmented Classical Models versus Raw-String Neural Matchers},
year = {2026},
howpublished = {\url{https://github.com/DZhang3210/address-matching-by-pair-type}}
}
Model tree for zhangdav/address-matching-by-pair-type
Base model
distilbert/distilbert-base-uncased