This is a chatbot app for answering questions on the domain of blood donation. It uses a dynamic few-shot prompting technique, retrieving the best matching samples from a vetor database containing FAQ extracted from American Red Cross
- Install all required dependencies from
requirements.txt
with a dependency manager or your choice - Or, if using pipenv, just run
pipenv install
inside the project folder
To run the app enter the following command:
$ streamlit run gui.py
To run the chatbot feature on the command line execute the bot.py
script:
$ python bot.py
To add new samples to the database run the add_data.py
script and pass a json file as argument containing the samples (see example below):
$ python add_data.py <path_json_file>
JSON file:
{
"data": [
{
"question": "question (str)",
"answer": "answer (str)",
"category": "category (str | null)"
},
{
"question": "question (str)",
"answer": "answer (str)",
"category": "category (str | null)"
}
]
}
Here are some examples of questions you might ask:
- What should I expect during the blood donation appointment?
- What are the eligibility criteria for donating blood?
- How much time should I wait between donations?
- Why is it important to have a diverse blood donor base?
- Can I donate blood if I’m taking medication or have a medical condition?
- How should I take care of myself before and after donating blood?
- How does blood donation affect my daily activities or exercise routine?
- How long does it take to donate blood, including registration and recovery?
- Am I able to donate blood if I have a tattoo?
- How does my weight and height affect the donation?