Skip to content

NishantkSingh0/RAG_Model

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 

Repository files navigation

Retrieval-Augmented Generation (RAG) Model for AI Information

Overview

This project implements a Retrieval-Augmented Generation (RAG) model using Pinecone, and a pre-trained GPT-2 model. The goal of this model is to generate accurate and contextually relevant answers to questions related to AI by combining the retrieval capabilities of Pinecone with the generative power of GPT-2.

Components

Dataset Preparation:

A dataset containing comprehensive information about AI was curated. The dataset was transformed into embeddings using SentenceTransformer for efficient similarity search.

SentenceTransformer:

The SentenceTransformer model was used to convert text data into high-dimensional vectors (embeddings). These embeddings capture semantic meanings and are crucial for the retrieval step.

Pinecone:

Pinecone is a vector database used to store and query the embeddings. When a query is made, Pinecone retrieves the most relevant pieces of information from the stored embeddings based on their similarity to the query.

GPT-2:

GPT-2, specifically the GPT2LMHeadModel and GPT2Tokenizer, is used for generating text. The retrieved information from Pinecone is passed to GPT-2, which then generates contextually relevant and coherent responses. Workflow

Data Transformation:

The AI information dataset is first transformed using the SentenceTransformer model to create embeddings. These embeddings are stored in the Pinecone vector database.

Query Processing:

When a query is received, it is transformed into an embedding using SentenceTransformer. This query embedding is used to search the Pinecone database for the most relevant pieces of information.

Text Generation:

The retrieved information is then passed to GPT-2. GPT-2 uses the context provided by the retrieved information to generate a response to the query.

Question: what is AI

Answer (in a concise and clear manner):

AI is an artificial intelligence that advances technology to recognize human and other forms of behavior, such that human consciousness evolves to become a superior

Releases

No releases published

Packages

No packages published