What is Neural Search?
Tags: opensource, machinelearning, ai, todayilearned
Published: 2021-05-13 11:52:18

---
title: What is Neural Search?
published: true
description: Learn what is Neural Search and how to get started with it without prior experience in Machine Learning.
tags: opensource, machinelearning, ai, todayilearned
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hx4nsf7zes7eqndngi1a.png
---

What is Neural Search and how to get started with it without prior experience in Machine Learning


> TL;DR: Neural Search is a new approach to retrieving information using neural networks. Traditional techniques to search typically meant writing rules to “understand” the data being searched and return the best results. But with neural search, developers don’t need to wrack their brains for these rules; The system learns the rules by itself and gets better as it goes along. Even developers who don’t know machine learning can quickly build a search engine using open-source frameworks such as [Jina](https://github.com/jina-ai/jina).

Table of contents

*   What is Neural Search?
*   Evolution of search methods
*   Rules vs Neural Networks
*   Applications Of Neural Search
*   Get started with Neural Search

## What is Neural Search?

![Graphics - search bar](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gt7eaa3xbeo0s3hss0vl.png)

There is a massive amount of data on the web; how can we effectively search through it for relevant information? And it’s not just the web where we need it: Our computers store terabytes of company and personal data that we need to work with; we need effective search to get our day-to-day job done. And what do I mean by effective search

*   Can we go beyond just matching keywords?
*   Can we search using natural language, just like we would write or speak?
*   Can we make the search smart enough to forgive our minor mistakes?
*   Can we search for things that aren’t an exact match but are “close enough”?

We can answer all those questions with one word: Yes. To understand how, we need to enter the world of Natural Language Processing. NLP is a field of computer science that deals with analyzing natural language data, like the conversations people have every day.

NLP is the foundation of intelligent search, and we have seen three different approaches in this field as follows.

## Evolution of search methods

![Graphics for evolution of search methods](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4h5rr32nmmv51wzo6oyu.png)

1.  **Rules (1950–1990s)**  
    Complex handwritten rules that emulate Natural Language Understanding.  
    **Drawbacks:** Handwritten rules can only be made more accurate by increasing their complexity, which is a much more difficult task that becomes unmanageable over time.
2.  **Statistics (1990s — 2010s)**  
    Probabilistic decisions based on weights, machine learning and feature engineering.  
    Creating and managing rules was solved with machine learning, where the system automatically learns rules by analysing large real-world texts.  
    **Drawbacks:** These statistical methods require elaborate feature engineering.
3.  **Neural Networks (Present)**  
    Advanced machine learning methods such as deep neural networks and representation learning.  
    Since 2015, statistical methods have been largely abandoned, and there has been a shift to [neural networks](https://en.wikipedia.org/wiki/Neural_network) in machine learning. Popular techniques using this method make it a more accurate and a scalable alternative. It involves
    * Use of word embeddings to capture semantic properties of words  
    * Focus on end-to-end learning of higher-level tasks (e.g., question answering)



> When you use Neural Networks to make your search smarter, we call this a **Neural Search System**. And as you will see, it addresses some of the critical shortcomings of other methods.

Note that the applications of Neural Search are not just limited to text. It goes well beyond what NLP covers. With neural search, we get additional capabilities to search images, audio, video, etc.

Let’s look at a comparison of the extreme ends of search methods — “Rules” vs “Neural Networks”:

## Rules (Symbolic Search) vs Neural Networks (Neural Search)

![Comparison of Symbolic Search vs Neural Search](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qfpridpq9e24gc1yfs8x.png)

While the Neural Search method has become more widespread since 2015, and should be the primary focus area of any new search system, we shouldn’t completely rule out Symbolic (rule-based) Search methods. In fact, using a combination of Neural Search and Symbolic Search may result in optimized results.

Let’s look at some of the powerful applications of Neural Search

## Applications Of Neural Search

### Semantic search

🔍 addidsa trosers

(misspelled brand and category, still returns relevant results similar to query “adidas trousers”)

![Example of semantic search](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/b2nhboecyhauhvojq5so.png)

### Search between data types

With Neural Search, you can use one kind of data to search another kind of data, for example using text to search for images, or audio to search for video.

![Example of cross modal search](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/c9g8yknhzs07vwh1or1n.png)


### Search with multiple data types

With Neural Search, you can build queries with multiple query data types e.g. search images with text+image

![Example of multi modal search](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6tma9qft12bctl4v0u1z.png)


## Get started with Neural Search

For rule-based searches, Apache Solr, Elasticsearch, and Lucene are the de-facto solutions. On the other hand, Neural Search is relatively new on the scene, there aren’t so many off-the-shelf packages. Not to mention, training the neural network for such a system requires quite a bit of data. These challenges can be solved using [Jina](http://github.com/jina-ai/jina/), an open-source neural search framework. To get started with building your own Neural Search system using Jina:

*   [Learn basic concepts of Jina](https://youtu.be/zvXkQkqd2I8)
*   [Start playing around with Jina](https://github.com/jina-ai/jina/)
*   [Build your first Jina app](https://docs.jina.ai/chapters/my_first_jina_app/)

---------

**References**

*   Neural Search term is less academic form of the term Neural Information Retrieval which first appeared during a [research workshop in 2016](https://www.microsoft.com/en-us/research/event/neuir2016/)
*   [Learning to rank](https://en.wikipedia.org/wiki/Learning_to_rank)
*   [Natural Language Processing](https://en.wikipedia.org/wiki/Natural_language_processing)
*   [Neural Network](https://en.wikipedia.org/wiki/Neural_network)
*   [Building cross-lingual product search using Tensorflow](https://hanxiao.io/2018/01/10/Build-Cross-Lingual-End-to-End-Product-Search-using-Tensorflow/#recap-symbolic-approach-for-product-search)
*   [What is neural search and why should you care](https://towardsdatascience.com/what-is-neural-search-and-why-should-i-care-4a6cee6b2249)
*   [Information Retrieval](https://en.wikipedia.org/wiki/Information_retrieval)
*   [Related to Information Retrieval](https://en.wikipedia.org/wiki/Category:Information_retrieval_genres)
*   [Search Engine Technology](https://en.wikipedia.org/wiki/Search_engine_technology)
*   [Introduction to neural Information Retrieval](https://www.microsoft.com/en-us/research/uploads/prod/2017/06/fntir2018-neuralir-mitra.pdf)
*   [Content based image retrieval](https://en.wikipedia.org/wiki/Content-based_image_retrieval)
*   [An anatomy for Neural Search engine](https://www.sciencedirect.com/science/article/pii/S0020025518309952)
*   [How google search works](https://www.youtube.com/watch?v=0eKVizvYSUQ), and [a more in-depth video](https://www.youtube.com/watch?v=tFq6Q_muwG0)