Writing a journal is a pastime and lifeline for many people. Journals allow for the expression of personal, complicated thoughts and ideas in a way that can’t be ridiculed by others. There are many suicide cases per year, and each case brings with it an investigation into the life of the victim right before death. What if we could predict the future before they take their life? That is the goal of Cogni Journal.
Cogni Journal is an interactive journal system for depression patients that allows them to write journal entries which spark a conversation with an artificial entity driven by the latest in artificial intelligence. The artificial journal entry reader tries to keep a positive and silly attitude while responding to over journal entries, which can help keep spirits up for the patient. A therapist can use this system, providing a look into the topics her patient discusses and she can also receive texts when Cogni Journal determines a patient of hers is having suicidal thoughts. Also, if a patient is diabetic, the Cogni Journal will use the Johnson & Johnson OneTouch Reveal API to make him or her aware of the relationship between diabetes and depression.
Context of Creation
Cogni Journal was created on January 22 thru 24, 2016 as part of PennApps XII, held at the University of Pennsylvania in Philadelphia, Pennsylvania. The project was created by Christopher Frederickson, Nick Felker, Jeffery Gilbert, and Max Bareiss.
More than one million people every year attempt suicide in the United States, and 14.8 million people live with depression. All of these people can be helped. Cogni Journal can provide Cognitive Behavioral Therapy, which has been shown to help with many kinds of depression or suicide-likely individuals.
- Online journal functionality allows patients to store and write journal entries online.
- Online Artificial Intelligence powered by IBM AlchemyAPI converses with the patient and attempts to improve their mood.
- Therapist interface allows for monitoring for patients using this program.
- If a patient makes suicidal statements, an SMS alert will be sent to their therapist using Twilio.
- If the patient mentions that they are lonely, an upcoming event will be offered using data from Everyblock.
- If the patient is a diabetic, they can connect to Johnson & Johnson’s One Touch Reveal API and Cogni will factor the patient’s blood sugar levels into its response.
The key component of the chatbot in Cogni Journal is the IBM AlchemyAPI. Here we use two components: the sentiment extraction and keyword extraction with sentiment (positive vs. negative). First we collect a large text sample from the patient (a journal entry), then we extract keywords from it, and respond to those keywords with manually generated phrases that are chosen based on the sentiment of the keywords in that text. For example, if we have the following text:
Today I went to the store and bought celery. Celery is interesting because it tastes really good, and you're guaranteed to lose weight. Strawberries on the other hand are terrible and I would never want to have one.
The response is:
I think your experience with Strawberries has brought you some grief. Tell me more about Strawberries.
After this, the chatbot speaks to the patient about strawberries in a sympathetic light:
Strawberries don’t taste very good and have little green things on top that don’t taste good.
Sometimes that’s the way it is.
The first iteration of the software had its several components built but not integrated. The therapist menus used sample data. The journal menus did not save entries. The AI could respond to your phrases, but without an API to call it.
The second iteration of the software began to combine several of these disparate systems together. The journal and therapist menus were integrated using a consistent design. An API was generated to talk to the AI and store results in a database.
The third iteration of the software began to connect the frontend to the backend. The journal interface could connect to the AI, sending it messages and displaying its responses. After all of the systems were finally connected, several bugs were found and time was spent fixing our integrations.
The fourth iteration of the software focused on improving the overall stability. The backend, both the AI and the server, fixed critical bugs that would appear occasionally. New APIs were also created that were integrated with the front end to enable more functionality. This is the final version.