Problem
Cian has many listing filters, and not every user manages them. Support often gets requests such as «find me an apartment in Moscow», partly because filters are hard to use. The team wanted users to type a query in free form, find a listing faster and click «show phone number» more often. There was no labeled dataset, and the work had to fit into an internal hackathon of about 48 hours.
Example from the article: the query «Buy a one-room apartment in Moscow up to 10 million» has to become pre-filled filters (action type, property type, region, number of rooms, price).
Solution in brief
A BERT model tags entities in the query (region, town, street, property type, rooms, price and others). Regular expressions and Levenshtein distance map them to filter values, and the existing listings service does the retrieval. Training queries come from Google and Yandex referrals, labeled by hand in doccano and enlarged by substituting entity values.
Questions this case answers
- How to turn a free-text query into structured filter values for a catalog search when no labeled queries exist yet
- How to build a first labeled dataset for entity tagging from unlabeled logged queries, and improve it when the model fails on unseen names
- How to let users type a free-form query and get a listings search with pre-filled filters instead of clicking through many filters?
- How to get training data for a query-tagging model when there is no labeled data, only logged search queries?
Tools and methods
- Named entity recognition (token classification) — tags query words with entity labels in B_/I_/O format
- BertForTokenClassification and rubert-base-cased-conversational (DeepPavlov) — the tagging model
- doccano — in-house labeling tool with access rights and statistics on completed tasks
- Dataset augmentation by value substitution — replaces entity values in a query using the listings database
- Regular expressions and Levenshtein distance — map entity text to filter values
Google or a one-time email code. No password.
