Flip: Changing the Narrative on Suicide

Here’s our story of winning HackMentalHealth Yale’s mental health hackathon.

Winners of HackMentalHealth Yale

Going into Hack Mental Health 2019, we were five (almost) strangers with backgrounds ranging from clinical psychiatry to coding and communications. After 24 hours of researching, hacking, and bagel-eating, we had become team Flip, a cohesive unit with a browser extension that detects potentially harmful suicide-related web content and presents users with constructive alternatives. Following is a brief summary of what we did, how we did it, and where we’d like to go from here!

All of the members of our team came to Hack Mental Health with a desire to apply cutting-edge technology to promote mental health, but without a solid conception of how we would accomplish such a goal. After discussing several project ideas on Friday evening as part of a larger group, our team of five crystallized the following morning: New Haven residents David (a neuroimaging researcher), Eden (a psychiatry resident), and Victor (a software engineer) had identified each other in the HMH Slack channel based on their shared interest in adolescent mental health, and were soon joined by Karelyn (a research analyst) and Ammaar (a Math/Economics undergraduate). Although we were interested in tackling suicidality, our team was aware of the significant challenges facing suicide prediction and prevention. We wondered if there might be some way to intervene post-suicide by addressing the harmful effects of suicide-related social contagion.

Why build a suicide-related browser extension?

Suicide is the third-leading cause of death in young populations (ages 15–24), and the problem is getting worse: suicide rates across the lifespan have risen 25% in the past seventeen years. This upswing in suicidality has been paralleled by a steady increase in the portrayal of negative media information. Furthermore, spikes in suicide rates have been observed following prominent suicides (such as those involving public figures), and localized ‘clusters’ of suicides occur at the community level in a similar manner, particularly among adolescents. This kind of social contagion is spread in part through social media platforms and other online content. Existing products can filter and block this content; we want to talk about it. Suicide happens, and it hurts. We need healthier ways of addressing it.

Drawing inspiration from reappraisal and related theories as well as powerful machine learning models, we’re excited to introduce Flip, a dynamic browser extension aimed at changing this narrative.

What is Flip?

Flip is a Google Chrome browser extension that works by flagging web content containing information known to support social contagion effects. Once this content has been identified, Flip uses natural language processing to characterize its semantic makeup and find relevant articles that offer a more productive take on the same issue. Finally, Flip presents alternative options in the form of a browser notification, suggesting a way to flip the script on how we talk about suicide.

Flip in action!

How does it work?

First, Flip receives the URL of the page the user is currently reading and sends it to a Flask server, where a Python package called Beautiful Soup is used to parse the page’s HTML content. Beautiful Soup’s output is then scanned for certain suicide-related keywords, and if a potentially destructive article is identified, the parsed text is sent to Google Cloud’s Natural Language API. Using powerful machine learning algorithms, this API returns information like the frequency of entities (e.g. “college student”, “sports”, etc.) mentioned and emotional sentiment (valence and magnitude) of the text to our extension. After some cleaning and reformatting using an in-house Python script, the semantic content of relevant entities from the target article is compared to the semantic content of productive suicide-related articles in our carefully curated database. This process relies on Sematch’s word-level similarity functionality in conjunction with Wordnet, an expansive lexical database, and produces a ranked list reflecting how semantically similar the target article is to each of our constructive curated articles. Next, the most similar constructive article in our database is suggested to the user in the form of a friendly browser notification. Finally, we understand that in some situations, suggesting an article isn’t enough. For individuals experiencing a crisis, we’ve included an element in our notification that links to a suicide text hotline. From detection to suggestion, code for all of Flip’s components can be found in our Github repo.

What’s next for Flip?

Hack Mental Health 2019 might have wrapped up three days ago, but our work with Flip is far from finished. Starting with some much-needed spring-cleaning on our code, we’re looking forward to continuing to develop our product and vision. With some awesome features and designs in the works (e.g. increased user customizability, more dynamic UI), we couldn’t be more excited to see where this project will lead.

We’re incredibly proud of how much we accomplished in such a short time, but we couldn’t have done it alone. We’d like to give a huge thank you to the rock star organizers, mentors, and friends who provided us with incredible suggestions and guidance along the way, and we encourage anyone reading this post to consider getting involved with events like Hack Mental Health!

Our team:

David Gruskin — Neuroscience Research Assistant @Yale University

Eden Almasude — Psychiatry Resident @Yale University

Victor Mutai — Software Engineer @LogMeIn, Inc.

Karelyn Kuczenski — Senior Research Analyst @Ipsos

Ammaar Ahmed — Math/Econ @ Rutgers University.

References:

Klonsky, E.D., Saffer, B.Y., & Bryan, C.J. (2018). Ideation-to-action theories of suicide: A conceptual and empirical update. Current Opinion in Psychology, 22, 38–43.

Klonsky, E.D. & May, A.M. (2015). The Three-Step Theory (3ST): A new theory of suicide rooted in the “Ideation-to-Action” framework. International Journal of Cognitive Therapy, 8, 114–129;

Tolin, D.F., McKay, D., Forman, E.M., Klonsky, E.D., & Thombs, B.D. (2015). Empirically supported treatment: Recommendations for a new model. Clinical Psychology: Science and Practice.

Niederkrotenthaler, T., Gould, M., Sonneck, G., Stack, S., & Till, B (2016). Predictors of psychological improvement on non-professional suicide message boards: content analysis. Psychological Medicine, 46, 3429–3442.