NameBERT

Name-based nationality classification across 98 countries, from a multilingual BERT model trained on LLM-augmented open academic data.

๐Ÿ“„ Paper: NameBERT: Scaling Name-Based Nationality Classification with LLM-Augmented Open Academic Data (arXiv:2604.10401) Cong Ming, Ruixin Shi, Yifan Hu

๐Ÿ’ป Code: github.com/Ruixin-J-Shi/nameBERT_nationality_classification

Please read the paper for the data construction pipeline, training setup, evaluation, and the limitations discussion. This repository hosts the fine-tuned checkpoint.

What's here

File Description
model.safetensors Fine-tuned bert-base-multilingual-cased weights (98 classes)
config.json, tokenizer*.json, vocab.txt, special_tokens_map.json Model config and tokenizer
meta.json Label โ†” index mapping (idx2label, label2idx) and MAX_LEN=40
DATA_TERMS.md Terms of use for the weights

config.json uses generic LABEL_<i> names. Map predicted indices to countries with meta.json, as shown below.

Quick start

pip install torch transformers huggingface_hub
import json, torch
from huggingface_hub import hf_hub_download
from transformers import AutoTokenizer, AutoModelForSequenceClassification

repo = "jxins/nameBERT-nationality-classification"
tok = AutoTokenizer.from_pretrained(repo)
model = AutoModelForSequenceClassification.from_pretrained(repo).eval()
meta = json.load(open(hf_hub_download(repo, "meta.json"), encoding="utf-8"))
idx2label = meta["idx2label"]

names = ["Ruixin Shi", "Yifan Hu"]
batch = tok(names, padding=True, truncation=True, max_length=meta["MAX_LEN"], return_tensors="pt")
with torch.no_grad():
    probs = model(**batch).logits.softmax(-1)

for name, p in zip(names, probs):
    scores, idxs = p.topk(3)
    print(name, [(idx2label[str(i.item())], round(s.item(), 3)) for s, i in zip(scores, idxs)])

Intended use and limits

NameBERT predicts a probabilistic association between a name string and a country of academic affiliation. It does not determine an individual's nationality, ethnicity, or citizenship, and must not be used to make decisions about individuals โ€” including hiring, admissions, visa, or screening decisions. Accuracy is not uniform across the 98 classes. See DATA_TERMS.md for the full disclaimer.

The training data is not distributed. It maps real, named researchers to inferred nationality, which is personal data about identifiable people. See Training data.

License

Research use only. No commercial use. Attribution required. See DATA_TERMS.md.

Derived from the Open Academic Graph (Microsoft Academic Graph + AMiner). Attribution and the required OAG citation are in DATA_TERMS.md.

Citation

We kindly request that any published research that makes use of these model weights, the aggregate training data, or any data derived from them cites the following paper.

Cong Ming, Ruixin Shi, and Yifan Hu. NameBERT: Scaling Name-Based Nationality Classification with LLM-Augmented Open Academic Data. arXiv:2604.10401, 2026. [PDF]

@article{ming2026namebert,
  title  = {NameBERT: Scaling Name-Based Nationality Classification with LLM-Augmented Open Academic Data},
  author = {Ming, Cong and Shi, Ruixin and Hu, Yifan},
  year   = {2026},
  eprint = {2604.10401},
  archivePrefix = {arXiv},
  primaryClass = {cs.CL}
}
Downloads last month
14
Safetensors
Model size
0.2B params
Tensor type
F32
ยท
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for jxins/nameBERT-nationality-classification

Finetuned
(1021)
this model

Paper for jxins/nameBERT-nationality-classification