concept synonym expansion in category deep learning

appears as: synonym expsion, synonym expsions
Deep Learning for Search

This is an excerpt from Manning's book Deep Learning for Search.

I’ll explain how you can use a technique called synonym expansion to make it possible to express the same information need in several ways. Although synonym expansion is a popular technique, it has some limitations: in particular, the need to maintain a dictionary of synonyms that will likely change over time and that often isn’t perfectly suited to the data to be indexed (such dictionaries are often obtained from publicly available data). You’ll see how you can use algorithms like word2vec to learn word representations that help generate synonyms accurately based on the data that needs to be indexed.

Figure 2.15. Token stream after word2vec synonym expansion

Let’s start by seeing how to implement a search engine with synonym expansion enabled at indexing time. The simplest and most common approach for implementing synonyms is based on feeding the search engine a vocabulary that contains the mapping between all the words and their related synonyms. Such a vocabulary can look like a table, where each key is a word and the corresponding values are its synonyms:

aeroplane -> plane, airplane, aircraft
boat -> ship, vessel
car -> automobile
...

Imagine that you feed the lyrics of “Aeroplane” into the search engine for indexing, and you use synonym expansion with the previous vocabulary. Let’s pick the chorus of the song—“music is my aeroplane”—and see how synonym expansion handles it. You have a simple text analysis pipeline composed of a tokenizer, which creates a token every time it encounters whitespace, resulting in creating a token for each of the words in the sentence. The index-time text analysis pipeline will thus create these tokens. Then you’ll use a token filter for synonym expansion: for each received token, it will look at the vocabulary of synonyms and see if any of the keywords (“aeroplane,” “boat,” “car”) is equal to the token text. The posting list for the fragment “music is my aeroplane” (sorted in ascending alphabetical order) will look like table 2.1.