Dementia and other diseases of cognitive decline can be prevented or delayed through cognitive stimulation, social interaction, and general lifestyle choices. This makes a chatbot an optimal tool to prevent them. Our chatbot can answer queries about specific items of curiosity and deliver it with little interaction from the user, since learning new knowledge can help in cognitive decline prevention. It can also handle general chitchat, adding to the user’s social interaction, and answer questions relating to dementia to help the user make better lifestyle choices outside of the app. Finally, it has a trivia game that can train a user’s memory to prevent dementia just through playing it and also potentially keep track of the efficacy of the user’s memory.
- Can accurately answer both specific content questions and conversational chitchat using multi-model architecture
- Multiple chat platforms supported
- Voice input as voice output allows for natural vocal communication with chatbot for accessibility purposes
- Extensibility allows for new domain knowledge and games to be easily added to system.
How we built it
We used Rasa as a framework for our chatbot. After the user input/message is classified according to intent, what happens next depends on the intent. We added FAQs relating to dementia and hard coded the answers to make sure that the information was there at all times and reliable.
For more general queries along the lines of “what is __” or “who is ___”, we used entity extraction to get the keyword of what the user wants to know more about, queried the Wikipedia API for a related article, and sent the text of the article back to the user.
To handle chit chat and times where the user input doesn’t fall neatly into an above category, we used a versatile pretrained model called BlenderBot. This is trained using billions of datapoints and conversations to end up with a very flexible and organic-sounding response.
To make the trivia game, we used the Rasa form feature that iterates on itself to ask more and more question until the user returns “stop”. It pulls trivia questions and answers from a free online api for this purpose.
Challenges we ran into and what we learned
An initial challenge was coordinating the development of the different technical components for the chatbot. We learned how to coordinate how to simultaneously work on chatbot files without code conflicts through splitting up configuration files. In addition, we learned how to coordinate internal apis so someone developing the website can easily link the chatbox widget up with a chatbot server.
Another challenge was simply configuring the environment for running a rasa chatbot. Especially when using rasa-x, rasa’s tool for quickly chatting with the bot and annotating training data during development, running the installation for the different python packages required would quickly lead to conflicts and a general bad time. In this, we learned two things: the power of trial and error in finding version numbers of each package that work with the others, and how to use docker containers to quickly duplicate a working environment across multiple systems.
The most pressing challenge was how to incorporate both specific content knowledge and general conversational capacity into a single chatbot. We learned how to use Rasa’s pipeline and fallback features to specify confidence levels at which Rasa would use the more versatile blenderbot model. In short, we used a multimodel approach to enable a wide range of functionality to help combat dementia.
What's next for Citizens Fight Dementia
- Keep track of percentage answered correct in word games, analyze score trends to detect early signs of dementia.
- More word games incorporated into chatbot following example of trivia game.
- Built-in mood detection models ran on user input to allow chatbot to respond effectively to different user emotions.
- Reminder functionality to remind users of lifestyle habits that can prevent dementia as well as general reminder capability for those with memory loss.
- Locator for help facilities and support group related to mental health and cognitive decline based on user’s location