Views
No views yet
bert_vietmap_gmaps_p21
Base model: outputs/pretrain/bert_compact_v2
Trained on: Vietnamese address corpus (mixed sources)
Saved at: 2026-07-04T08:00:00+00:00eval_gmaps:
gmaps→v2 label mapping + reconcile, exactly what the API does), not raw token
scores — so they reflect real end-to-end address parsing quality.| Metric | Value |
|---|---|
| Macro F1 (gmaps gate) | 0.7663 |
| Address accuracy | n/a |
| PLACE_NAME F1 | n/a |
| Robustness macro F1 | n/a |
| Metric | Value |
|---|---|
| Boundary precision | n/a |
| Boundary recall | n/a |
| Boundary F1 | 0.7663 |
<PAD>B-DISTRICTB-NEIGHBORHOODB-POIB-PREMISEB-PROVINCEB-ROUTEB-STREET_NUMBERB-SUBPREMISEB-WARDI-DISTRICTI-NEIGHBORHOODI-POII-PREMISEI-PROVINCEI-ROUTEI-STREET_NUMBERI-SUBPREMISEI-WARDO1from transformers import pipeline
2
3ner = pipeline("token-classification", model="open-thienhang-com/viet-address-v2", aggregation_strategy="simple")
4ner("123 Nguyễn Huệ, Phường Bến Nghé, Quận 1, TP Hồ Chí Minh")
5# → [
6# {'entity_group': 'HOUSE_NUMBER', 'word': '123', ...},
7# {'entity_group': 'STREET', 'word': 'Nguyễn Huệ', ...},
8# {'entity_group': 'WARD', 'word': 'Phường Bến Nghé', ...},
9# {'entity_group': 'DISTRICT', 'word': 'Quận 1', ...},
10# {'entity_group': 'CITY', 'word': 'TP Hồ Chí Minh', ...},
11# ]1from transformers import AutoTokenizer, AutoModelForTokenClassification
2import torch
3
4tokenizer = AutoTokenizer.from_pretrained("open-thienhang-com/viet-address-v2")
5model = AutoModelForTokenClassification.from_pretrained("open-thienhang-com/viet-address-v2").eval()
6
7inputs = tokenizer("123 Nguyễn Huệ, Phường Bến Nghé, Quận 1, TP HCM",
8 return_tensors="pt", truncation=True, max_length=256)
9with torch.no_grad():
10 out = model(**inputs).logits
11pred_ids = out.argmax(-1)[0].tolist()
12labels = [model.config.id2label[i] for i in pred_ids]
13tokens = tokenizer.convert_ids_to_tokens(inputs.input_ids[0])
14for t, l in zip(tokens, labels):
15 if l != "O" and l != "<PAD>":
16 print(f" {t:20s} → {l}")vncorenlp word segmentation required).PLACE_NAME is the rarest label, so its precision is lower than CITY / WARD.1@misc{phobert,
2 title = {PhoBERT: Pre-trained language models for Vietnamese},
3 author = {Dat Quoc Nguyen and Anh Tuan Nguyen},
4 year = {2020}
5}