Open data: matching the unmatchable with a neural network

Aleksandr Nikitin, Andrey Rumyantsev18 Nov 2022

Problem

Tochka Bank uses open data from the Federal Bailiffs Service (FSSP), which publishes enforcement proceedings, and wants it in its credit scoring model. The debtor company in the FSSP file has only a name and an address, with no tax ID (INN) and no state registration number (OGRN), so the file cannot be joined to other registers. Names repeat and are spelled in many ways, and addresses are outdated or differ between registers. Exact joins and plain string matching fail.

Example from the article: "Lenin Street" exists in almost every Russian locality, so a street match alone says nothing. Only the house number, city and region separate similar addresses.

Solution in brief

Normalize the name and address of each record, join them into one string, and fine-tune a Russian BERT sentence encoder so that the same company gets close vectors across sources. Negatives are look-alike records from TF-IDF neighbors. In production, the nearest register vector found with pgvector gives the missing INN. Validation accuracy rose from 77% to 91%.

Questions this case answers
  • How to link records from two sources that share no unique key and describe the same entity with differently written names and addresses
  • How to train a text-similarity encoder for record matching when the labeled data has only positive pairs
  • How to run nearest-neighbor lookup over millions of vectors in production when an in-memory index would need tens of gigabytes
  • How to attach a tax ID to company records from an open dataset that lists only a company name and address?

Tools and methods

  • TfidfVectorizer (scikit-learn) — vectorizes name and address strings to find look-alike negatives
  • faiss — nearest-neighbor search over the training vectors
  • rubert-base-cased-sentence with Sentence-Transformers — base encoder, fine-tuned as a siamese network on cosine distance
  • pgvector (Postgres) — stores register embeddings and serves nearest-neighbor lookup
  • Docker and Kubernetes — deployment of the two matcher jobs
Continue reading — it's free

Google or a one-time email code. No password.