An Artificially Intelligent therapist could provide much-needed support to people who are struggling with mental health issues. Often, people who are struggling with mental health issues are not able to access traditional forms of therapy, or they may be reluctant to seek help from a human therapist. An AI therapist could provide a non-judgmental, supportive space for people to explore their thoughts and feelings. Existing AI therapists lack a human touch and are not able to maintain a rapport since responses feel like they lack depth and consistency in personality.

What it does

We built a sophisticated AI Therapist capable of maintaining human-like rapport and utilizing a simulated concept of empathy to generate responses and ask questions to a patient. We also built a website that can be used to interact with the AI therapist over voice and text.

How we built it

It is said that humans are the product of their experiences, Using a novel approach for training our machine learning model we simulated humanity within our AI therapist by training it on experiences. Included in this dataset of experiences that we created are details about their childhood, beloved memories, fears, their college years, their loves/heartbreaks, etc. Patients often request therapists that share a subset of experiences with them such as the same cultural background, sex, or race - using this approach different therapists could be generated to best suit the needs of different patients so the AI therapist is better able to empathize with them.

The experiences inputted into the dataset are filtered down and simplified over multiple layers using natural language processing to keywords. These keywords are normalized within a probability distribution and this makes up the personality of the AI therapist. Additionally, based on experiences in the dataset a set of traits are generated for the therapist such as their physical attributes, their perspective on spirituality/religion, etc that further add a dimension of being a real person.

When a user sends input through our website as a message to the therapist, the emotions and characteristics that holistically make up our AI therapist’s personality are taken into account when generating a response. In addition to responses, the therapist can also ask questions. It does this by simulating a list of potential questions it can ask and the answers a patient might give. It uses this as context to determine the motivations of the patient before framing a question with respect to its personality.

Challenges we ran into

We created a website using Flask and had to resolve various issues with styling, JavaScript, and jQuery.

This project used OpenAi and we created a web of layers and generated prompts in order to link the various components such as the experiences, emotions, characteristics, and the conversational engine.This web will allow future datasets of experiences to automatically create a dynamic personality for the AI therapist. However, the process of creating that web using proper prompt generation and input/output merging was a time intensive process where we experimented with modifying prompts across the layers in order to generate better, more human-like outputs.

What we learned

We learned how to create a website using the Flask web development framework. Along with that, we got lots of practice using CSS, JavaScript, and jQuery that will serve us well in the future. Regarding machine learning, we learned a lot about managing multiple different models, input/output merging, data cleaning, and prompt generation.

What's next for AI Therapist

Deploying the website so it is public facing after doing a security audit and adding text to speech for violet and voice input for the patients so it feels more natural than texting.

Built With

+ 21 more
Share this project: