(IN ORDER TO USE OUR LINK BELOW, PLEASE USE THE GUEST WIFI. THE PROJECT LINK IS IN THE README IN THE GITHUB LINK)

Inspiration

As high school students passionate about mental health, all 3 of us are part of our high school’s mental health club called Bring Change to Mind. In this club we discuss ways to destigmatize mental health and ways to increase accessibility to mental health treatment in the school and in the community. One thing that we have discussed is that mental health resources and treatment options exist, but they are often hard to access. For example, our high school’s mental health page linked here is just filled with pages of links that are hard to navigate and find. https://www.metuchenschools.org/o/mhs/page/mental-health-resources We knew there must be a better way to get resources to students which is when we turned to the idea of machine learning chatbots.

What it does

This website allows users to interact with an advanced AI model to distribute mental health resources accurately. The model is trained to recognize signs of mental health distress and, from there, properly distribute information and resources to help the user. The interface contains a chat box for the interaction to take place and a dropdown menu for quick navigation to labeled links surrounding specific mental health issues. Our website helps people who need help find the resources that they need by analyzing their inputs. One good application of our chatbot is with younger students. For example, a middle school student might be dealing with test anxiety but may not know how to get help since they do not know what test anxiety is. If the student uses our chatbot they can type in something simple like "I am always very nervous and worried before taking exams." Our chatbot will then give the student anxiety resources that could help them learn more about test anxiety and some ways to manage anxiety. Our chatbot serves as the bridge between mental health resources and the general population by providing an easy to use and interactive way to get assistance for mental health challenges. Even if someone does not know specifically what they are struggling with or can't find all the words to explain their problems, the power of machine learning allows our chatbot to give people high quality resources to help them live higher quality lives.

How we built it

Back-end: Our back-end utilizes two machine learning models to accurately provide help and information. The first model we designed ourselves, using TensorFlow’s Sequential model, which we programmed to utilize a three-layer dense neural network. This neural network uses Gradient Descent to transform words into a numeric value to be analyzed by our neural layers. These neural layers contain 128 neurons, 64 neurons, and 8 neurons, respectfully, to distinguish between our 8 tags. When our neural network does not yield a clear-cut choice, the request will route to OpenAI’s GPT-3, a model that is trained across the entire internet. Because of this, our program has the ability to answer almost anything you could think of. These two models together allow our users to gain access to mental health help and information on almost anything they can imagine.

Front End: The front end of this program utilizes various programming languages such as CSS, HTML, and javascript, as well as multiple other libraries and resources. It serves to give the user a clean and easy to use interface, with a chat option to talk to the robot and a menu to get quick links to sites that revolve around specific mental health issues. The Website also has other features such as a linear gradient background, and color functionality for the buttons the user interacts with, making the site extremely intuitive. The purpose of all this is to take whatever the user inputs into the site, communicate it to the backend for it to process the text, and finally take whatever the backend outputs and display it back to the user.

Server: To get these two parts working in unison, we utilize a Python server written with the library Flask. This library enables us to render HTML code to a local server which can interact with our two models. Our server handles the requests of the chat feature by receiving the user’s text, running it through our processor, and outputting the AI-generated response.

Challenges we ran into

When building our model, we noticed some irregularities during tests. The model would randomly associate words with topics, leading to some strange results. We debugged for about two hours until we found the smallest mistake, a single indent. After correcting this indentation, our model worked very well, but we came across another issue: our model could not handle requests unassociated with mental health. In order to fix this issue, we decided to implement Open AI GPT-3 into our chatbot. Open AI allows for our chatbot to use results from the internet in tandem to our training data to best respond to the user inputs. Now, our chatbot can provide help with mental health problems as well as answer almost any question that one could ask.

Accomplishments that we're proud of

This program was a significant achievement for all three of us as developers. It tried us on several issues, which we persevered through, and in the end, we achieved a working tensor flow model, a link into gpt-3's ai model, a stunning UI that is easy to interact with, and linking both the front and back end through the use of Flask API, which now allows the program to work seamlessly

What we learned

We learned how to connect python to javascript through the Flask library, which now lets us connect a robust backend to a gorgeous frontend whenever we are developing other solutions in the future. We also learned how our code can serve to benefit people and be a source of fundamental change in the world. While it may only be a project now, the capabilities are endless with this code, and real lives can be saved.

What's next for Mental Health Chat Bot

We firmly believe that in this day and age no student should have to struggle with finding mental health resources. We intend to continue working on this product to eventually launch it on our school’s websites to help the students at our school have better access to knowledge and resources about mental health. No student worldwide should have to struggle with finding mental health resources which is why we want to eventually expand to other schools nearby to try to get our chatbot on their websites. One improvement that we intend to make in the future to our chatbot is by sending automatic emails when students are in danger to their school counselors. For example, if a student is expressing suicidal thoughts in the chatbot, an alert will automatically be sent to their councelor who can help the student get the help that they need. We will accomplish this by using the Gmail python API. The application of chatbots for mental health has the possibility to save lives in the future and we hope to continue working on this project to help it reach the largest audience possible.

Built With

Share this project:

Updates