Inspiration
Mental health is such a prevalent issue today, and it is hard for people to take the initial step in seeking treatment. Often, those who do seek treatment have issues because of the lack of access to professionals, and the costs associated. We wanted to bring a free service that can supplement the need to visit therapists/psychologists/psychotherapists etc.
What it does
Ami.io is a chatbot and voice-controlled assistant that listens to you, then analyses what you tell her using sentiment analysis technology to understand how you're feeling and recommend treatment or lifestyle changes. The sentiment analysis Ami.io uses measures various metrics and then gives you an "at risk factor". The information Ami.io has gathered on you can be easily transferred to a clinical professional who can then provide a diagnosis and treatment. Ami.io is available on smart-home devices where you can talk to her about your feelings and thoughts. Ami.io is not a replacement for therapists but a casual advice-giver who can help address issues that you may not be aware of and can help you seek treatment. It is meant to be the first step towards getting access to mental health services.
How we built it
Botsociety We initially used Botsociety to create a prototype chat-bot which can accept speech in both text and voice format. Ami.io then analyzes what has been said and responds accordingly. Creating multiple paths for Ami.io to follow, we developed a bot that looks out for key terms to address your needs.
Python Created the algorithm that analyzes what the user inputs and teaches Ami what emotions the user might be feeling. It also teaches her how to respond. This was done by analyzing the text to scan for words that are key indicators of any major mental health issues such as "miserable", "depressed", "suicide". It then takes this information to score each candidate's Risk-Factor by giving them a "mood-indicator" which updates with every new message provided. It rates a score based on numerous metrics which can then be given to a therapist to analyze.
Challenges we ran into
Finding the right environment to develop Ami.io on. After testing out numerous platforms such as Webflow and MongoDB. After finally deciding to use botsociety and python, the project ran smoothly.
Accomplishments that we're proud of
What we learned
What's next for Ami.io
Next-steps would be to introduce supervised learning and performing linear-regressions on large datasets of responses to gain an even more accurate analysis and provide better recommendations for users.
CODE FOR SENTIMENT ANALYSIS
import random class Bot: def init(self):
self.data = {}
self.i = 0
self.total_mood_score = 0
self.generic_responses = ['Please, continue. ', 'Fascinating. What else happened? ', 'Wow. And then? ', 'Remarkable. Oh, apologies. Please, continue']
self.personal_pronouns = {'I':1, 'i':1, 'Me':1, 'me':1, 'Myself':1, 'myself':1}
self.num_personal_pronouns = 0
self.else_pronouns = {'You':1, 'you':1, 'Yours':1, 'yours':1, 'Your':1, 'your':1, 'They':1, 'they':1, 'Their':1, 'their':1}
self.num_else_pronouns = 0
self.untempered_sad_words = {'Miserable':1, 'miserable':1, 'Misery':1, 'misery':1, 'Depressed':1, 'depressed':1, 'Depression':1, 'depression':1, 'Suicide':1, 'suicide':1, 'Suicidal':1, 'suicidal':1, 'Hate':1, 'hate':1}
self.num_untempered_sad_words = 0
self.absolutist_words = {'Absolutely':1, 'absolutely':1, 'Always':1, 'always':1, 'Entire':1, 'entire':1, 'Everyone':1, 'everyone':1}
self.num_absolutist_words = 0
my_input = None
while my_input != 'Please stop now':
my_input = input('Please talk to the ChatBot about your problems for a while! ')
if self.i == 4:
self.i = 0
print(self.generic_responses[self.i])
self.i += 1
self.add(self.data, self.analyze(my_input))
print(self.data.keys())
def add(self, data, results):
data[results] = 1
def analyze(self,input):
listy = input.split()
for word in listy:
if word in self.personal_pronouns.keys():
self.num_personal_pronouns += 1
if word in self.else_pronouns.keys():
self.num_else_pronouns += 1
if word in self.untempered_sad_words.keys():
self.num_untempered_sad_words += 1
if word in self.absolutist_words.keys():
self.num_absolutist_words += 1
if self.num_personal_pronouns - self.num_else_pronouns >= 3:
self.mood_score += 2
self.total_mood_score += self.num_untempered_sad_words
self.total_mood_score += self.num_absolutist_words/2
return self.total_mood_score
def main(): my_chatbot = Bot() if name == 'main': main()
Built With
- botsociety
- python
Log in or sign up for Devpost to join the conversation.