Best Practices for Designing Chatbots in Mental Healthcare – A Case Study on iHelpr

This paper outlines the design and development of a chatbot called iHelpr for mental healthcare that 1) administers self-assessment instruments/scales, 2) provides wellbeing and self-help guidance and information, all within a conversational interface. Chatbots are becoming more prevalent in our daily lives, with bots available to provide the user with daily weather forecasts, book holidays, and even converse with a virtual therapist. It is predicted that users may soon prefer to complete tasks using a conversational interface that are traditionally done through a webpage or mobile application. In the context of mental healthcare, demand exceeds supply, waiting lists are ever growing, and populations in rural communities still struggle to access mental healthcare. Chatbots can be utilised to improve and broaden access to mental healthcare. When designing chatbots for mental healthcare, there are further considerations, such as managing risk and ethical considerations. Furthermore, usability and the design of conversational flow are important factors to consider when developing chatbots for any domain. This paper outlines best practices and experiences extrapolated from developing the iHelpr chatbot.


INTRODUCTION
The aim of this paper is to outline the design and development of iHelpr, a chatbot for mental healthcare.During the development of iHelpr, several best practices for chatbot design and development, chatbot usability and ethical considerations have been identified.

BACKGROUND AND CURRENT PRACTICES
Inspire Workplaces provide Employee Resilience Programmes and wellbeing solutions for private and public sector organisations, and educational institutions across Ireland.Their aim is to reduce presenteeism, and sickness absence by building employee resilience to promote wellbeing using evidence-based interventions.To broaden access and meet increasing demand, Inspire Workplaces are using digital support and information hubs alongside digitalised interventions to add to and complement existing human to human services.
Chatbots are a new kind of user interface, as described by Amir Shevat [1].Chatbots are becoming more prevalent in our lives, as it is now possible to purchase goods, check the weather [16] and talk with a virtual therapist [8].It has been predicted that users may soon prefer to engage with a conversational interface, such as a chatbot, to complete activities that are traditionally done through a web page or mobile application [9].
A SWOT analysis of chatbots in mental healthcare is summarised in Table 1.People living in rural communities, or shift workers, may have problems accessing mental health appointments, and chatbots could be used as a potential solution to this, and to help reduce waiting lists [12].There is potential to engage students, as in their study Bhakta, Savin-Baden, and Tombs found that students perceived talking to a chatbot as "safe" [2].Chatbots have already been used to support students during periods of exam stress [10].

Chatbots in mental health care
However, developers creating chatbots in mental healthcare need to be aware of ethical issues, as discussed later in this paper.Chatbots in mental healthcare are unable to mimic the level of empathy or understanding unique to human interventions.Building in human intervention and knowing when to use this is an important design feature to consider.

IHELPR
iHelpr has been developed using the Microsoft Bot Framework, using NodeJS with a MySQL database.Microsoft LUIS has been used to recognise user utterances and match it to the correct intent.iHelpr is encased in an online portal called the Inspire Support Hub, which is a new product for Inspire Workplaces.This portal allows customers to log in with their unique identifier and utilise many features to help with their mental wellbeing.The first feature on the landing page is a searchable database based on the five ways to wellbeing [15], where users can find ways to connect, give, take notice, be active and keep learning in their local area.
Another feature is an online self-help library, with reading materials on common mental health conditions including stress, anxiety, depression.There is an e-library of bibliotherapy books, and elearning programmes, on stress, anxiety & depression, sleep, trauma and alcohol.Finally, there is an online diary function, where users can track their moods, and input journal entries.iHelpr is then used as a digital intervention tool, and its features are discussed in the next section.

Features
iHelpr provides guided self-assessment on the following topics: stress, anxiety & depression, trauma, sleep and alcohol.Each area enables the user to complete a self-assessment instrument, to identify particular areas of difficulty.The psychometrically validated instruments used are as follows, the Perceived Stress Scale (PSS) for stress [5], PCL5 for trauma [22], the Audit questionnaire for alcohol [17], The Sleep Condition Indicator for sleep [7], GAD7 for anxiety [18], and the PHQ-9 for depression [11].The PSS is traditionally administered in a paper-based format, were the user circles their answer for each question, and manually calculates their score.
Using a chatbot can reduce the amount of time spent answering these questions, and the score is calculated automatically.The next question appears after the user answers the previous question, which mimics the way an assessment would be administered verbally, as shown in Figure 1.Furthermore, tailored advice with evidence based recommendations and links to computerised self-help programmes are provided by iHelpr.The users scores are saved in a database, to allow them to look back and identify if their scores have improved over a period of time and track their progress.Adopting a stepped care approach, advice and evidence-based treatment recommendations are guided by which band the users score falls into.The intervention options given are:  Utilise the Self-help library, and Bibliotherapy library.
 Start an e-learning programme aligned to the presenting issue identified.
 Calling the Inspire Workplaces 24/7 helpline, which may progress into structured telephone, skype or face to face counselling with Inspire Workplaces.Or contact information for statutory services or emergency services.
Within iHelpr, there is the option for the user to receive either transdiagnostic -generic or specific coping strategies and techniques on each of the aforementioned mental health conditions.These are pulled from a database and were written and validated by domain experts.A web-based form was created for domain experts to automatically insert coping mechanisms into the database, to allow for knowledge engineering (encoding expert knowledge into a machine retrievable form) and also for variation in the advice given by the bot which improves the user experience and encourages engagement as they are not receiving the same coping mechanisms in each scenario.A mood tracker functionality can be utilised, where the user can communicate with iHelpr to rate their mood daily, add comments on their mood, and record how many hours sleep they gotto create a mood diary within the Inspire Support Hub which can subsequently be reviewed by a mental health practitioner to formulate a tailored intervention.
To create rapport, establish and maintain engagement with the user, iHelpr has been programmed to use an Open Weather Map API, to check the weather and integrate this into the conversation and greetings.Giphy API has been used to pull a variation of GIFs into the conversation where appropriate, to add humour to the conversation.Furthermore, the database holds a variation of jokes, to add humour and build rapport.

Chatbot Usability
Conversational flow is an important aspect of bot design, and Candello and Pinhanez have shown the use of the Wizard of OZ technique to identify conversation flow stoppers, and provide insights and recommendations for prototype design [3].
Cramer and Thom highlight that users will try to test the chatbot, and this needs to be considered when designing the conversation [6]. Build in a long term and short-term memory in order to develop an intelligent relationship with the user  Build in conversational delights e.g.sarcasm, self-deprecation etc.  Use these positive inducing techniques when having to apologize for not understanding certain utterances. It is important to be mindful of culture, as words and humour may mean different things to different cultures.

Ethical Considerations
It is important that product and service designers and developers understand ethics during systems engineering as there have been many cases where designers and developers have implemented system features that violate ethical norms for the user.For example, there has been the use of approaches based upon nudge theory, persuasive technologies and emotional design which in effect manipulate the behaviour of users do things they would ordinarily not countenance (coined by some as 'Evil by Design' and 'Dark Patterns ').This is of particular relevance in the field of mental health where users may be defined as vulnerable adults.
Product and service designers and developers are having difficulties getting access to and understanding ethical guidelines related to creating, adopting, or using a system, service or product.Whilst the User Experience Professionals Association (UXPA) do have a set of ethics principles for User Experience (UX) designers, these principles are mostly aligned to the ethics of the designer and not the design (admittedly these are partly related).
Mulvenna et al. [14] presented an ethical by design manifesto of principles that can be used to guide systems development.Their manifesto includes the following twelve principles: (1) Design to support the people who will be using the product or service by engendering empathy for users (2) Provide enough information for people to make informed decisions at every stage about whether, when, and how to use the product or service (3) Respect people's right to choose how they engage with the product or service; offer alternatives or customisation (4) Balance appropriate privacy and security with equitable access by as many systems and people as possible, globally (5) Seek to integrate with and support the progression of policy (6) Actively look for and challenge biases and values that may be reflected in a product or service design (7) Complement differing needs, abilities, viewpoints and morals (8) Support shared decision making and feedback (9) Aim for economically, environmentally, and socially sustainable designs (10) Integrate planning for how to handle failure, including transparency and reporting (11) Be realistic about what is possible and needed (12) Support the product or service throughout its lifespan.
It is argued that the 'ethical by design' manifesto principles offer a blend of accepted and proven approaches drawn from successful application and use in different disciplines that directly address risk, ameliorate errors and ensure that teams can relate ethical guidance to the technology development tasks to be undertaken.
The IEEE Global Initiative on Ethics of Autonomous and Intelligent Systems also propose a set of principles, to guide 'Ethically aligned design' [19].These include ensuring the design does not violate human rights laws, prioritise well-being in design and use, ensure the designers are responsible and accountable and operate in a transparent manner, and minimise the risk of misuse.

DISCUSSION
The most challenging part of the iHelpr project was designing the conversations, which is a central part of bot development.Conversational design is not something computer scientists are trained in, and designing conversations is much different that designing graphical user interfaces.Conversations in a mental healthcare context must be clinically robust, to engage the user in a safe and effective way.Observing human to human conversations in the context of mental healthcare is crucial to developing an engaging conversational flow.
Many tools and frameworks are now available to develop chatbots, and it can be challenging to establish which set of tools are the most suitable to your project.The Microsoft bot framework is robust; however, challenges are still present.The support for design in the web chat and direct line channels is limited, as adding an icon to these channels is difficult.When developing chatbots, there are many new concepts for a developer to learn, such as intents, utterances and entities.However, there are plentiful resources, such as Chatbots Magazine, books and video tutorials that can be utilised when building a chatbot.When developing a chatbot, the development and testing phases are much more interlinked than traditional software development.The developer is required to constantly review and test the chatbot in the bot emulator.Furthermore, as there are many different channels a bot can be deployed to, testing can be a lengthy process.

CONCLUSION
This paper has reviewed the design and development of the inspire chatbot, iHelpr.Best practices on design, development, usability, and ethical considerations have been presented.