Instructions to use jxins/nameBERT-nationality-classification with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use jxins/nameBERT-nationality-classification with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="jxins/nameBERT-nationality-classification")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("jxins/nameBERT-nationality-classification") model = AutoModelForSequenceClassification.from_pretrained("jxins/nameBERT-nationality-classification", device_map="auto") - Notebooks
- Google Colab
- Kaggle
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
Model tree for jxins/nameBERT-nationality-classification
Base model
google-bert/bert-base-multilingual-cased