Skip to content

rena9155/Chatbot_v2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AI powered chatbot

Table of Contents
  1. Project Description
  2. Approach
  3. Instructions
  4. Evaluations
  5. Conclusion
  6. Contact

Project Description

This project explores different methodologies in creating a QA chatbot for local knowledgebase.

Approach

Three approaches were used to create this chatbot. In the notebook folder, you can find different models.

The notebooks/baseline_model comprise a Question-Answering Search Engine utilizing Transformers. Initially, the documents were encoded by a Bi-Encoder, followed by retrieving the top 5 most relevant pieces of information from the corpus. Subsequently, the model re-ranks these top 5 candidates through a cross-encoder, and the highest-ranked result after re-ranking is selected as the answer.

Several other models were developed by leveraging Large Language Models.

The first solution is an open-source solution. We employed Hugging Face embeddings and Google's Flan-T5 as the Large Language Model for synthesis. Further details can be found here: notebooks/Flan_T5

The winning model is a hybrid solution, where we utilized Hugging Face for embeddings and OpenAI to synthesize the answer. Additional details can be found here: notebooks/Hybrid_Model

Instructions

The material used to construct local knowledge base in this case, is a PDF. A sample statistics textbook is provided and can be found in the data folder. All notebooks were created using Google Colab. To execute the notebooks:

  1. Upload the material to a Google drive folder, and get the folder id.

  2. Copy the folder id of each of the subfolders and saved them into 'folder_id' variables

Evaluations

Results generated by the chatbots were compared manually with the sample answers. The outcomes are as follows:

Hybrid Model: 78% Flan-T5: 40%

Conclusion

In a remarkable feat, this chatbot has attained the ability to answer questions with human-like proficiency. Notably, it possesses multilingual capabilities. Despite training on an English corpus, the Chatbot can aptly address inquiries in virtually any language. This achievement was made possible by integrating Google Translator—when posed in German, questions receive responses in German.

Moreover, we employed prompt engineering techniques to ensure that the Chatbot responds exclusively to context-based queries. This enhances the precision and relevance of its responses

Contact

If you find this repo interesting or would like to suggest improvements, please get in touch. we would be happy to hear from you.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published