Chapter 3: Generating synonyms

 

Chapter 2 from Deep Learning for Search by Tommaso Teofili.

This chapter covers

  • Why and how synonyms are used in search
  • A brief introduction to Apache Lucene
  • Fundamentals of feed-forward neural networks
  • Using a word2vec algorithm
  • Generating synonyms using word2vec

Chapter 1 gave you a high-level overview of the kinds of possibilities that open up when deep learning is applied to search problems. Those possibilities include using deep neural networks to search for images via a text query based on its content, generating text queries in natural language, and so on. You also learned about the basics of search engines and how they conduct searches from queries and deliver relevant results. You’re now ready to start applying deep neural networks to solve search problems.

In this chapter, we’ll begin with a shallow (not deep) neural network that can help you identify when two words are similar in semantics. This seemingly easy task is crucial for giving a search engine the ability to understand language.

2.1. Introduction to synonym expansion

2.1.1. Why synonyms?

2.1.2. Vocabulary-based synonym matching

2.2. The importance of context

2.3. Feed-forward neural networks

How it works: Weights and activation functions

Backpropagation in a nutshell

2.4. Using word2vec

2.4.1. Setting up word2vec in Deeplearning4j

2.4.2. Word2vec-based synonym expansion

2.5. Evaluations and comparisons

2.6. Considerations for production systems

2.6.1. Synonyms vs. antonyms

Summary