# 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: tutorial

Language: en

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

Topics: [AI search](<https://devfeed.tech/topics/ai-search.md>), [Natural language processing](<https://devfeed.tech/topics/nlp.md>), [Databases](<https://devfeed.tech/topics/databases.md>), [sentence-transformers](<https://devfeed.tech/topics/sentence-transformers.md>), [Computer science](<https://devfeed.tech/topics/computer-science.md>)

Tags: [databases](<https://devfeed.tech/tags/databases.md>), [embeddings](<https://devfeed.tech/tags/embeddings.md>), [nlp](<https://devfeed.tech/tags/nlp.md>), [openai](<https://devfeed.tech/tags/openai.md>), [search](<https://devfeed.tech/tags/search.md>), [techniques](<https://devfeed.tech/tags/techniques.md>), [vector](<https://devfeed.tech/tags/vector.md>), [word-embeddings](<https://devfeed.tech/tags/word-embeddings.md>)

## AI overview

This introductory tutorial contrasts semantic search with lexical search, explaining how semantic search uses query context and intent to improve result relevance. It also introduces NLP, embeddings, and vector databases as implementation components.

## 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