The UK's first sexual health chatbot

Chatbot Pat

Chatbot

|

2017-2018

|

United Kingdom

Challenge

Positive East received grant funding for an ambitious project: to build an automated chatbot which could provide its users with confidential sexual health advice. The chatbot would allow the user to find sexual health resources such as testing locations, respond to (and triage) concerns about whether a user has an STI, and address other common sexual health questions a user might have. This would be available via a confidential conversational interface.

Solution

Python, AngularJS, AWS, AWS Lex

Our designer took a data-driven approach to the chatbot script design, creating a survey that Positive East shared at festivals and with affiliate websites that established what sexual health information users looked for online. Analysing the data, it was found people generally searched for sexually health information within a few main categories. It also established the chatbot’s demographic and confirmed the question – would you use a chatbot to find information about your sexual health.

Guided by survey data, the designer wrote a script that answered frequent questions. They relied on sources approved and provided by Positive East to ensure answers were reliable and consistent with their advice.

We built the chatbot in line with this script using AWS Lex – the same natural language processing engine behind Amazon Alexa. We trained the chatbot using example phrases, taking into account slang, misspellings and synonyms. Lex’s machine learning abilities allow the bot to take this training data and extrapolate other similar phrases, allowing it to understand an impressive range of conversation.

At the same time, we designed and built two chat interfaces: a full screen version, and a pop-up corner version. Both versions can be embedded within any website with a few lines of code.

We also built an extensive test framework from scratch. This test framework runs through thousands of sample conversions each time a new version of the chatbot is deployed, and the results compares to the script. As machine learning models can sometimes be quite unpredictable, this allows us to detect any incorrect behaviour before changes go live.

Integrations

We built an HIV test booking system into Pat, where users of the chatbot can search for available STI and HIV test clinics and book an appoints without leaving the conversation. We built a custom Salesforce API integration so that the chatbot could work with Positive East’s existing Salesforce booking system without requiring any change in Positive East’s workflow.

To enable users of the chatbot to search for clinics near them, we also integrated with the system with the Google Maps API so that we could determine the distance between the clinic and the user’s postcode.

Results

The chatbot we built – called Pat – is up and running and can be accessed at Positive East’s website. Pat is providing advice every day on over 100 topics. Pat has advised its users about how to find HIV testing locations, whether they are at risk of STIs, and general information about medicines such as PrEP.

The Positive East team has demoed Pat with great success – obtaining support from Public Health England so that we can expand the range of topics Pat can deal with. Positive East has also been in contact with other organisations, including other charities and NHS trusts, to deploy Pat on their own sites. The chatbot framework we built for Pat allows the core conversions to be combined with new behaviour specific to an individual organisation – so it can be easily white labelled.

Our monitoring framework means that we are able to provide Positive East with frequent reports on how the chatbot is being used, allowing future development on Pat to focus on the most frequent conversions users are having.