With the rise of Covid-19, many people have started developing mental illnesses. Some, especially those with depression and/or suicidal thoughts, have expressed that even small messages can make a lasting, positive impact on their emotions. We noticed two things: (1) due to the stigma of having a mental disorder, many people don't want to ask for help or even realize that they have an invisible illness, and (2), small and random bursts of positivity can sometimes help make more of an impact that actively trying to control one's emotions all at once. With this in mind, we decided to dig deeper into the role mental illnesses play online, specifically in Reddit.
What it does
Ada is a Reddit-based chatbot that uses machine learning to take a new approach to helping people with depression. When run, the program takes information from recent Reddit posts in certain subreddits and runs the contents through a machine learning model. It is able to then distinguish whether or not the post hints toward depression or suicidal thoughts, with over 83% accuracy. If a post shows signs that a user may be depressed, the chatbot replies to the post with gentle comments that may lift the user's mood.
How we built it
The entire project was built on Google Colaboratory. We first used data scraping and found datasets with different Reddit posts. Some Reddit posts were from r/depression and r/SuicideWatch, which is the data we classified into "depressed." The Reddit posts which did not come from these subreddits were classified as "not depressed." We then started cleaning the data, both through algorithms and manually on excel. "Depressed" was assigned the number 1 and "not depressed" was assigned then number 0. Then we used natural language processing to train the model to figure out when a person's post hinted at depression. The model tracked linguistic patterns like commonly used words to figure out whether or not the person was possibly depressed. After training the model with 80% of the data, we then used the remaining 20% to test it out. The chatbot portion was created with PRAW and the Reddit API. If a post was classified into "depressed," the chatbot would comment something nice on the post. It would select from a random list of various compliments and other nice things to say.
Challenges we ran into
A huge challenge we ran into was combining the machine learning model with the chatbot. We each did one part, which required different variables and tools, so it was hard to figure out how exactly to get the two parts to work in harmony. We had to program the chatbot to change its inputs into .csv files that could be then run through the machine learning model. We also had to tweak a bit of the natural language processing to match the chatbot.
Accomplishments that we're proud of
Neither of us has ever tried to create a bot before and neither of us has had any proper experience with machine learning, so we're extremely proud of having created this! It is essentially our first ML project ever and we're so happy that it worked!
What we learned
We learned that sometimes it's good to be a risk-taker. This entire hackathon, we were scared that we would have to change our project last minute because we both had no experience with machine learning. We just really wanted to try, so we took a risk. We were both so happy when it finally worked at 8 AM in the morning. If we hadn't decided to try the project, even if it was complex, we would have never gotten this knowledge and experience.
What's next for Ada the Chatbot
We want to add more professional messages, deeper research, searching comments, and potentially a more interactive chatbot. We're thinking of continuing this after the hackathon to see where it goes!