In today's world, the prevalence of poor mental health within our communities has been exponentially increasing. Even at our high school, TJHSST, some students are known to be chronically depressed and sleep-deprived, leading to unfortunate suicidal ideation. Over 20% of Americans are experiencing mental health issues and nearly 93% of those Americans are unable to receive care. Despite resources such as the Suicide Hotline Number, there have been over 50,000 suicides last year in the United States alone. We are seeking to improve the suicide hotline technology and help mitigate this problem.

What it does

TheraSpeak is a 2-part service, providing aid for both people who need help with mental health, as well as Hotline Workers who may need aid in some situations. We created a phone number service that will connect users to an AI language model trained on mental health resources and specifically prompt-engineered to provide concise and inquisitive responses over SMS messaging and call support. The phone number, hosted on Twilio, connects the caller with an operator on the other side. Hotline workers using TheraSpeak get real-time AI suggestions and help based on the conversation with the caller. Along with this, they can also provide links and messages directly to the caller while preserving anonymity.

How we built it

TheraSpeak Website (Front-end) We implemented a home page that describes the purpose of our project including our solution and background information, an about page (a team page with all of us), and a login system that allows the hotline worker to go into the portal and choose whether they want to access the text or the call playground web app. The playground has a live transcription interface (the text playground allows the user to respond to the user) and a section full of prompts. We used different animations and gradients from Tailwind CSS to make our website stylistic, and we integrated the backend code to the HTML using JavaScript fetches that get in the data from our backend code.

Text functionality (Back-end) We used the Twilio API and phone line to create a chat center that could receive messages from external phones. We then implemented the OpenAI API and prompt-engineered response that would aid a caller/hotline worker. Our first step was to send the generated advice straight to the suicide patient for fast, human-independent, assistance. We then incorporated supervised text-based connections via the TheraSpeak website to allow for more human messages to be sent when responders are available.

Audio/Call Based When a Suicide Caller calls the hotline number, the hotline responder keep their phone on speaker the backend will transcribe the audio that is being sent the computer.The transcription will run through OpenAI to get a suggestion and send it to front end website, where it will be displayed for the responder to choose to incorporate it in their conversation with the caller. The responder can give their feedback on the suggestion, providing feedback for reinforcement learning.

Languages Used Our backend services are written in Python, and we used React Native to build our mobile app. We used JavaScript, HTML 5, and Tailwind CSS to design our website (front-end).

Challenges we ran into

It was difficult to get each of our services working together since we were a distributed team. Although we got most of the individual parts working early on, integrating the font and back end took the most time and presented a lot of challenges, especially with the dependencies and OS differences between our computers.

Accomplishments that we're proud of

I am proud of the Chat-bot we created that can send Chat-GPT responses directly to a text-based user. This is incredibly effective and streamlines the suicide hotline and GPT process with seemless integration. I am also proud of our Voice interpretation script that sends voice commands to chat gpt and returns the output as text messages to the console. The integration of these techniques into our TheraSpeak Website is incredibly impressive, and best of all, it is incredibly applicable and will help give fast service to suicidal callers and provide suggestions to hotline responders so they can improve their calls.

What we learned

Learned to use Flask to develop web applications with python backend. Learned how to make website animation such as typing text animation. Learned to use PyAudio for audio collection and transcription Learned how to use APIs such as OpenAI, Twilio, and Metaphor to incorporate in both our front and backend.

What's next for TheraSpeak

Now that we have a solid framework and working design, this application can be modified and used in flexible ways. Our next step would be to allow TheraSpeak to directly communicate with the user verbally. Along with this, tweaking the prompt by a little could automatically help a user with other issues such as financial help or help them with immediate medical emergencies. Along with that, we want to make the website more dynamic and have the information powered by Metaphor so that we can provide more live links directly related to the goals we need.

Built With

Share this project: