Finding your next home, with neural property embeddings

Muhammed Salih
NoBroker Engineering
7 min readJul 25, 2021
a 3 D t-SNE plot of sample of NoBroker properties with NB Brain

Imagination is everything. It is the preview of life’s coming attractions

— Albert Einstein

At NoBroker.com, we have been at the forefront in driving innovations with AI in C2C real estate. From keeping the platform broker-free to ensuring sanity in our listings, we have been solving some of the toughest challenges in the C2C space with the power of Machine Learning.

Here we present NB Brain — A novel representation for real estate entities inspired from NLP. We present the idea with reference to a smart recommendation system which has improved the Acceptance Rate of our recommendations by around 4 fold. By Acceptance Rate we mean the proportion of users showing interest in a recommendation sent by the System.

As we speak, NB Brain is assisting our paid customers finding their ideal rental home.

Word2Vec algorithm and Word Embeddings

NB Brain is nothing but an embedding of homes listed on NoBroker.com inspired from NLP. Before discussing the idea of property embeddings, let’s see how they work in its original setting i.e. in word embeddings.

Word embeddings re nothing but a representation of words in real valued vector space in such way that the words in the space follows relational properties closer to that of real language semantics of these words.

These representations are built with Machine Learning algorithms. One such method was introduced by Mikolov et al. in 2013; very popular among ML community by the name Word2Vec. There are 2 architectures in this — CBOW & skipgram. NB Brain works with a skipgram architecture.

The skipgram model uses a shallow neural network with a single hidden layer to predict the context words using a centre word. In the example shown below, you can see that ‘back-alleys’ is the centre word and using it we try to predict the the words occurring in a fixed window size around it. In the example shown here, the window size considered is five.

There is good enough literature on how skip gram models are trained. So we shall not go into the details of it. In a nut shell, you represent all the words in your vocabulary as vectors and then you train a large corpus of text of your domain with a neural network on an objective of predicting the surrounding words, until you obtain a vector space of words in your vocabulary such that the semantic relationships are captured in that vector space. A very nice example is the following relationship.

king — man + woman ~= queen

We expect the word vectors in the new space to capture such relationships. Word vectors in such a space are what we call embeddings.

Latent relationships between words are learned because of the large number of co-occurences and phrase usages in the corpus that the model sees at the time of training.

Using Word2Vec to create property embeddings

Now lets talk about real estate. In real estate, the products which we call properties/homes are heterogeneous; Every item is unique in its location, building and type. This makes search difficult, due to information asymmetry, and lack of substitutability. Recommendations with item-item based and user-user based collaborative filtering poses a number of challenges owing to the same reason.

Houses are unique, but carries similarities. People seeking homes are unique but carries similarity. We need a system that understands that similarities and can connect houses and people.

Let’s borrow the idea of Word2Vec from NLP discussed above and think of representing the properties in a vector space carrying semantically desirable properties.

To draw parallels, in this language, property features (1 bedroom, South Bombay, fully furnished etc.) are words; properties are sentences made out of these words; and set of properties interacted upon by a tenant customer can be thought of as a paragraphs constructed out of these properties (sentences).

So the problem of predicting the next property that a user would be interested in becomes similar to predicting what the next sentence in the paragraph or document would be. We accomplish that by approximating the paragraph (user) to be the average of all its constituent sentences (properties) and then finding the sentence (property) from the list of all available sentences (properties) which is the most similar to the paragraph (user).

Now the question is how do we train this representation and create a vector space/embeddings that would follow these properties.

It all comes down to how well we represent our properties using features/property attributes. Once that is done, we can simply train a skipgram model with user interaction behaviour from historical data. We know from our past data what set of properties are interacted together by users. Using this, we can learn the relationships between our property attributes.

Poorer representation of original space would mean poor representation of the resulting vector space.

f(🗑️) = 🗑️

A real estate property can be represented using a number of attributes like number of bedrooms, carpet area, price, age, flooring, etc. These attributes are easy to represent. However there is one important attribute of a property in real estate; they say it is location, location & location. Representing location of properties is tricky. You cannot do it with names — For example HSR Layout, Koramangla 1st Block etc. Because, administrative boundaries have hardly any relationship with how people search for homes.

Of course, people look for houses in definite regions, but in an urban settlement, people are mostly oriented in preferences based on streets, junctions, signals, landmarks etc. rather than administrative regions.

To solve this, we created a representation of locations which we call micro locality grids. These grids are small rectangles of A meters X B meters where A & B are defined such that within a grid of size A x B, interest levels of users do not vary much. For example in Bangalore a 250m X 250m might make sense, however in Mumbai, it can be as small as 100m X 100m.

Once these city level grids are created, we create a mesh of grids with indexes and represent property locations using these grids. For example, one can represent a property as follows — (3 bedroom, 1800 sqft, Rent 25,000, Semi Furnished, Grid 1042). This is only an example — our original property representation has many more features.

We have had hundreds of thousands of properties listed on our platform, with millions of users doing millions of interactions. This gives us a very good learning set to learn the relationship between attributes. We did the same and here is the result w.r.t how the embedding space captured the relationships between localities.

The above map shows streets that have common interests in the city of Bangalore. Please note the above map is a representational example with limited clusters for better appreciation. The actual relationships are much more fine grained at micro-locality level. The following map shows how homes and streets look at micro locality level.

A zoomed in view of street mapping in a micro locality

Making recommendations using property embeddings

We have discussed how embeddings can be created for each property in our dateset using the learned Word2Vec model. Now let’s see how these embeddings can be used to make relevant recommendations to a user.

For that, we represent each user also by a representative vector in this same embedding space. The user vector would be created based on the requirements that they have given and the set of properties that they have already contacted. For example, let’s consider the case of a particular user on the NoBroker platform named ‘User A’.

User A’s profile

Let’s assume that the user interacted on 3 properties →Property 1, 17, 13

Using this information of the user we can create a user vector. This user vector can be the weighted summation of the property embeddings of properties 1, 17 & 13. The weights can be based on things like recency of interaction, number of duplicate interactions etc. For now, for simplicity, lets take equal weights.

userA_vector = 1/3*(Property 1 Vector+ Property 13 Vector +Property 17 Vector)

This user_vector is nothing but an average of the kind of the properties that the user is interested in — A taste vector.

Now we can use this average vector and search our space of property embeddings such that properties closest to this average vector can be used to make recommendations to the user.

The following GIF from the domain of music recommendation depicts the idea even better.

That is it. The above methodology has helped us increase the acceptance rate from 3–4% to 12–15% in our paid tenant servicing. We will be rolling this down soon to general users.

The important thing here is, rather than improving the quality of recommendations, it is the quality of embeddings — which we call NB Brain that is important. With a good quality embedding, we will be able to do a lot more with these embeddings.

For example:-

  • These embeddings can be used as feature vectors to do price predictions
  • They can be used to identify relationships between localities in the city
  • They can be used to identify fake listings
  • They can be used to create personalised search feeds

And the good news is that we have just started with the idea of NB Brain and there is more to come. Efforts are currently undergoing to take advantage of the transformer architecture to take this idea to the next level. So, stay tuned for more updates.

--

--