Question and Answer Model

 




INTODUCTION

In today's rapidly changing technological landscape, demand for intelligent Question and Answer (Q&A) models has rose across a wide range of domains, from customer service to information retrieval. The LangChain framework is a novel approach to developing robust Q&A models that harness the power of Generative AI. To create a seamless and efficient solution for answering user queries, this framework combines sophisticated data preparation, advanced information retrieval techniques, and the capabilities of generative models.
The LangChain framework not only improves Q&A system efficiency, but it also addresses the growing demand for contextual understanding and natural language processing. LangChain enables Q&A systems to provide dynamic and context-aware responses by leveraging the potential of generative AI models, thereby improving user satisfaction and engagement.
We wanted to implement this model using LangChain Framework in various aspects of the project like Data Preparation, Information Retrieval using Semantic Search Algorithm and storing them in a CSV.
And Generative AI concept in using a Large Language Model(a GPT(Generative Pretrained Model) of any open sourced models that are available in market) with some Prompt Engineering finally results in building a strong and intelligent Q&A model.

LITERATURE SURVEY 

Generative AI, exemplified by models like GPT, has advanced significantly, producing human-like text and finding applications in chatbots, content creation, and language translation. The LangChain Framework, a newcomer, specializes in Question and Answer (Q&A) tasks, showcasing adaptability and customization. The implemented Semantic Search algorithm, using the 'AllMiniLM-v6' model, aids Information Retrieval. The framework's potential for creative AI applications is highlighted, urging understanding, customization, and adherence to best practices. Emphasizing adaptability and openness to iterative improvements, the LangChain Framework is used comprehensively in a project, showcasing its novelty and cutting-edge nature. This approach, covering all project phases, distinguishes the framework in the generative AI field, offering intriguing possibilities for diverse applications. The project serves as an example of the framework's innovative capabilities in the dynamic realm of AI research and development.

OBJECTIVE

To implement a end-to-end model which only answers from the given documents provided(Eg : Java Text Book) and to stop the hallucination that the model already has.

It can also be used to implement our own chatbot for a particular organization only answering question about their organization. Example: SRU Chat Bot.


METHODOLOGY
A . DATA PREPARATION
This Data Preparation again includes 4 steps they are:

             Loading The Documents

             Creating Chunks

             Vector Storage

             Generating Embeddings   

B .  INFORMATION RETRIEVAL

C .  PROMPT ENGINEERING

D .  MODEL SELECTION


                                            Flowchart of proposed methodology

RESULT 

                                                                           Testing against a questions





CONCLUSION

After using six different models the accuracy of the models are listed in the above table. The highest accuracy is for ‘GPT-35-Turbo’ that is 86.1% , this is the original version that chatGPT is using currently. We are unable to move forward with this model as this is licensed after certain period of time and charges based on the usage of the model. Even though its accuracy is high compared to other models, as it is licensed we cannot move forward with this. The next highest accuracy is OpenLLaMa-3B model which is performing good for our use-case and the latency is about 10 to 15 seconds. So, by considering all the points we decided to use ‘OpenLLaMa-3B’ model for our use case.

When combined with rigorous data preparation and advanced information retrieval, the LangChain framework for Q&A systems demonstrates the transformative potential of Generative AI. LangChain paves the way for more intelligent, adaptive, and user-friendly automated information systems as technology advances, revolutionizing how we access and interact with knowledge in the digital age.

Finally, we can conclude that, by using LangChain framework, we can create a strong and intelligent Q&A model that can provide accurate and context-aware answers to user questions in a variety of domains where the user needs to retrieve the answer by combining data preparation, information retrieval, and Generative AI techniques.



Comments