# Semantic Search - Word Embeddings with OpenAI

DevFeed: [Semantic Search - Word Embeddings with OpenAI](<https://devfeed.tech/articles/semantic-search-word-embeddings-with-openai-24996.md>)

Original publisher: [Read original article](<https://codeahoy.com/2023/03/28/semantic-search-intro/>)

Author: umer

Published: 2023-03-28T00:00:00Z

Content type: article

Language: en

Sources: [Code Ahoy - Articles](<https://devfeed.tech/sources/code-ahoy-articles.md>)

Topics: [search-engines](<https://devfeed.tech/topics/search-engines.md>), [Embeddings](<https://devfeed.tech/topics/embeddings.md>), [AI-driven information retrieval](<https://devfeed.tech/topics/ai-driven-information-retrieval.md>), [Database](<https://devfeed.tech/topics/database.md>)

Tags: [context](<https://devfeed.tech/tags/context.md>), [embeddings](<https://devfeed.tech/tags/embeddings.md>), [meaning](<https://devfeed.tech/tags/meaning.md>), [nlp](<https://devfeed.tech/tags/nlp.md>), [search](<https://devfeed.tech/tags/search.md>), [search-technology](<https://devfeed.tech/tags/search-technology.md>), [semantic-search](<https://devfeed.tech/tags/semantic-search.md>), [vector-databases](<https://devfeed.tech/tags/vector-databases.md>)

## AI overview

Semantic search aims to rank results by the meaning and context of a query, while lexical search matches query words or variants in documents. The excerpt contrasts a lexical search for "computer science intro," which may return items matching only some query terms, with semantic search that would prioritize introductory courses, textbooks, or other foundational learning materials. It says NLP helps analyze context and word relationships, and identifies embeddings with vector databases as another implementation approach; the excerpt does not explain that approach further.

## Source excerpt

According to Wikipedia, Semantic Search denotes search with meaning, as distinguished from lexical search where the search engine looks for literal matches of the query words or variants of them, without understanding the overall meaning of the query. For example a user is searching for the term "jaguar." A traditional keyword-based search engine might return results about the car manufacturer, the animal, or even the Jacksonville Jaguars football team. However, semantic search would analyze the context and intent behind the user's query, such as whether they are interested in cars or wildlife, and then prioritize results accordingly. In this blog post, we will explore the underlying principles of semantic search, discuss its advantages over other types of search, and examine real-world applications that are transforming the way we access and consume information. Lexical Search Engines Lexical (Traditional) search engines have served us well using keyword-based search methods, looking for matching exact words or phrases in users' queries with those in documents/database. For example, if we search for the term "computer science intro" in a lexical / traditional search engine, it will return results that match one or more of my search terms. As you can imagine, the keyword matching approach often falls short when it comes to understanding what the user actually meant, often producing less accurate results. Semantic Search Enter semantic search -- a context-aware search technology that aims to improve search results by focusing on understanding the meaning and context behind queries. When a user inputs the query "computer science intro" in a semantic search engine, it would first attempt to understand the intent behind the query. In this case, the user is likely looking for introductory resources related to computer science. Based on this understanding, the search engine would prioritize search results such as introductory computer science courses or textbooks or other