Skip to content

It reflects the main purpose of the code, which is to perform semantic search on a dataset of text documents using FAISS for indexing and the Universal Sentence Encoder for generating embeddings.

Notifications You must be signed in to change notification settings

Abhi-37/Semantic-Search-using-Gen-AI-UniversalSentenceEncoder-FAISS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 

Repository files navigation

Semantic-Search-using-Gen-AI

It reflects the main purpose of the code, which is to perform semantic search on a dataset of text documents using FAISS for indexing and the Universal Sentence Encoder for generating embeddings.

In this code:

We fetch the 20 Newsgroups dataset, a collection of documents spanning various topics.

We preprocess each document by removing email headers, addresses, punctuations, and numbers, and convert text to lowercase for uniformity.

We utilize the Universal Sentence Encoder to generate embeddings, converting each document into a fixed-length numerical representation capturing its semantic meaning.

We construct a FAISS index, a fast similarity search library, and add the document embeddings to enable efficient similarity search.

We define a search function that preprocesses user queries, generates embeddings, and retrieves the most similar documents from the index.

We demonstrate the functionality with an example query ("motorcycle"), displaying the top results ranked by similarity.

About

It reflects the main purpose of the code, which is to perform semantic search on a dataset of text documents using FAISS for indexing and the Universal Sentence Encoder for generating embeddings.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages