Background: A project for DataSpeak, a data science consulting firm, to develop an AI customer service chatbot that could be used across multiple clients. This chatbot learns from a dataset and answer questions on domain-specific knowledge.
Purpose: There were three goals for the chatbot:
- Generate answers to user questions
- Pull information from a domain specific dataset
- Produce accurate answers
Techniques: RAG Llama-2, LangChain, LLMs
The model accurately responds to open-ended questions with information from the dataset in under 5min on GPU.
The model correctly picks from a list of multiple choice questions, displaying accuracy when answering customer questions.
final_chainlit_app.py
- Register to use Llama-2 on Meta.
- Get a Hugging Face API Key and add to config.py file.
- Install requirements.txt
- Link in a new context dataset
- Run chainlit locally through terminal:
chainlit run final_chainlit_app.py
UPDATED: chainlit_app.py
- Register to use Llama-2 on Meta.
- Get a Hugging Face API Key.
- Create a .env file and add your API key:
HUGGING_FACE_KEY='YOUR KEY HERE' - Install requirements.txt
- Link in a new context dataset
- Run chainlit locally through terminal:
chainlit run chainlit_app.py
Data for this project came from a public dataset of python questions and answers from Kaggle.
Data Link: https://www.kaggle.com/datasets/stackoverflow/pythonquestions
- Datasets were cleaned of html text, special characters, and capital letters.
- Question and answer datasets were merged into one questions-answer dataframe on Id column.
- Answers from a sample of 100,000 question-answer pairs were used as a context document for model development.
This model should be tested on each domain-specific dataset to ensure it is able to learn accurate answers to common customer questions. Additionally response times can be sped up by running the app through GPU and vector storage in Pinecone. This app will can be deployed over a web service for use by customers.


