1 AIT Asian Institute of Technology

Developing an interactive chatbot leveraging large language models using fastapi and langchain

AuthorDeepak, Kasyapa Sai
Call NumberAIT RSPR no.CS-23-04
Subject(s)Natural language processing (Computer science)
Human-computer interaction
Automatic speech recognition
NoteA research study submitted in partial fulfillment of the requirements for the degree of Master of Engineering in Computer Science
PublisherAsian Institute of Technology
AbstractNowadays, Chatbots are widely used across various domains such as customer service, e-commerce, healthcare and banking. Chatbots play an important role in enhancing user satisfaction and optimizing the work productivity. Since the various benefits of chatbots, It is crucial to develop a chatbot for domain specific tasks and make them easily acces sible to customers. Large Language Models (LLMs) provide an innovative approach in constructing chatbots that can engage in natural and adaptable conversations with users, seamlessly handling information inquiries. While this marks an exciting advancement, it is essential to acknowledge that these models have certain drawbacks. In this study, I pro pose an approach to create an efficient chatbot that addresses the limitations associated with relying solely on Large language models (LLMs). By incorporating retrieval-based language models, we tackle prevalent issues in chatbot functionality, aiming for a more nuanced and contextually aware system. In this research, we initially gathered and segmented data, subsequently employing an embedding model to generate dense representations.The enriched data was efficiently stored in Faiss, optimizing retrieval processes. This study compared fastchat-t5-3b, llama-2-7b, alpaca-2-7b, open AI’s gpt 3.5-turbo-instruct and observed that the fastchat T5-3b model outperforms the other LLMs across various criteria such as Relevance, fluency, coherence, factuality, and total score Through systematic experimentation with various retrievers, we adopted an ensemble approach that integrates faiss,bm25 retriever and embedding-based methodologies, lever aging the strengths of each for enhanced efficiency. Our comprehensive evaluation, en compassing embedding distance, labeled score string, and string distance metrics, re vealed the superior performance of the ensemble retriever over base models. This strategic integration of advanced language models with retrieval generation aims to overcome existing limitations, paving the way for a more sophisticated and natural question-answering chatbot. The ultimate goal is to elevate the chatbot experience, mak ing interactions more akin to human conversations.
Year2023
TypeResearch Study Project Report (RSPR)
SchoolSchool of Engineering and Technology
DepartmentDepartment of Information and Communications Technologies (DICT)
Academic Program/FoSComputer Science (CS)
Chairperson(s)Chaklam Silpasuwanchai
Examination Committee(s)Tripathi, Nitin Kumar;Attaphongse Taparugssanagorn
Scholarship Donor(s)AIT Scholarships
DegreeResearch Studies Project Report (M. Eng.) - Asian Institute of Technology, 2023


Usage Metrics
View Detail0
Read PDF0
Download PDF0