What Is Neural Search?¶
In this section, you will get an understanding of what neural search is and how it differs from existing search methods¶
Like anything in technology, search engines evolve over time. While programming languages evolved from structured programming to concurrency-oriented programming, search has evolved from catalog, to symbolic, to neural-network-based search:
Traditional search frameworks use rules and complex pipelines to parse the data being searched. Neural search, on the other hand, relies on neural networks which actually “understand” that data.
Why neural search?¶
Unlike traditional search methods, neural search offers a number of advantages:
When most people think of search, they think about a text box, like Google. That’s the traditional thinking, and that’s what traditional search frameworks offer: text-to-text search. If you want to offer a new language option in their search engine, implementing all the rules and logic is hard work.
With neural search, the algorithm does all the work. So if you want to switch from English to French, you just switch out an English language algorithm for a French one. Or if you want to search images, just drop in image recognition algorithm. There’s no need to rewrite the rules (since the algorithm “knows” them already).
In short, if data can be encoded to something a computer can understand, it can be searched with neural search.
Traditional searches are very brittle. For example, unless you create a rule that states “red”, “scarlet” and “crimson” are very similar, there’s no way the search engine would “know” that. So if a user searches
red sneakers, crimson or scarlet sneakers wouldn’t rank highly in the search results.
Neural search uses algorithms that have been trained on huge datasets to understand natural language. So it’s likely whatever synonym for red you can think up, the algorithm (and thus your search engine) already knows it. The result? Crimson and scarlet sneakers rank highly for the search term
In a similar way, without a spell-checking library, traditional search can’t understand that when a user types
pokey man they mean
pokemon. And even with a spell-checking library, often new words (like Pokemon) just aren’t in the dictionary.
Neural search can make a “best guess” in situations like these. If a word exists in the training dataset (which are often more up-to-date than spell-checking dictionaries) it can guess a user’s intent from their misspelled query.
Comparing neural and symbolic search¶
When we talk about “traditional search”, we typically mean symbolic search. Symbolic search frameworks include Lucene, Solr, and Elastic Search.
Comparing neural and symbolic search is like comparing apples and oranges. Symbolic search excels in its given domain of single-language NLP, while neural search is a lot more flexible but still relatively new.
While neural search has many advantages, there are still some situations where it makes sense to use traditional search:
Your search needs are constrained and unlikely to change over time
You are searching for text in just one language
Speed is more important than getting the most accurate results
You want to understand why you’re getting your those results
Your computing power is highly limited
You have a small amount of data (neural search requires big data)
On the other hand, there are some situations where neural search makes more sense
Your search needs are likely to expand over different languages and data types
Accurate results are important, even if you can’t perfectly understand why you got those results
You have a “noisy” set of data to search through
You don’t have much knowledge in the search domain
You want something that “just works” out of the box
Neural search in action¶
A search “works” if it understands and returns quality results for:
Simple queries: Like searching
Compound queries: Like
red nike sneakers
🇩🇪 nike schwarz (different language)
🇬🇧 addidsa (misspelled brand)
🇬🇧 addidsa trosers (misspelled brand and category)
🇬🇧 🇩🇪 kleider flowers (mixed languages)