Abstract
Background
Risky health behaviors place an enormous toll on public health systems. While relapse prevention support is integrated with most behavior modification programs, the results are suboptimal. Recent advances in artificial intelligence (AI) applications provide us with unique opportunities to develop just-in-time adaptive behavior change solutions.
Methods
In this study, we present an innovative framework, grounded in behavioral theory, and enhanced with social media sequencing and communications scenario builder to architect a conversational agent (CA) specialized in the prevention of relapses in the context of tobacco cessation. We modeled peer interaction data (n = 1000) using the taxonomy of behavior change techniques (BCTs) and speech act (SA) theory to uncover the socio-behavioral and linguistic context embedded within the online social discourse. Further, we uncovered the sequential patterns of BCTs and SAs from social conversations (n = 339,067). We utilized grounded theory-based techniques for extracting the scenarios that best describe individuals’ needs and mapped them into the architecture of the virtual CA.
Results
The frequently occurring sequential patterns for BCTs were
Conclusions
AI-led virtual CAs focusing on behavior change need to employ data-driven and theory-linked approaches to address issues related to engagement, sustainability, and acceptance. The sequential patterns of theory and intent manifestations need to be considered when developing effective behavior change CAs.
Keywords
Introduction
Risky health behaviors such as tobacco use, opioid addiction, and polysubstance abuse are major contributors to premature morbidity and mortality, of which tobacco consumption alone is responsible for killing about eight million people every year across the globe. 1 It is also responsible for rising healthcare expenditures as about US$1.4 trillion is spent annually for treating smoking-related illnesses. 1 According to a recent report, tobacco cessation rates in the USA remain low; even though about 68% of adult smokers expressed their desire to quit tobacco use, 55.4% attempted to quit and only 7.4% reported successful quitting in 2015. 2 Behavior modification is a core component of the management of these risky health behaviors. 3 It is a complex process and research has shown that a range of psychological and social processes influence the engagement of an individual in the sustenance of positive health behaviors. 4 Behavior change can be a daunting task, and oftentimes individuals relapse as they attempt to embrace and sustain a positive health change. Nearly 75%–80% of the smokers who attempt to quit, relapse before achieving six months of abstinence. 5 Therefore, supporting individuals to make a successful quit attempt and preventing relapse become a public health priority. 1
The best practice guidelines to support relapse prevention include a combination of pharmacological support such as nicotine replacement therapy (patches, gums, lozenges, etc.) or medications (e.g., Bupropion) and behavioral support delivered via face-to-face counseling sessions with a doctor or trained healthcare professional is found to be most effective for tobacco cessation. 6 However, only 25% of cigarette smokers reported using nicotine patches or gum during their most recent quit attempt, only 12.2% reported using tobacco cessation medications approved by the FDA, and only 15% sought help from a doctor or other healthcare professional. 7 One of the barriers to using these evidence-based conventional quit tools is that a majority of smokers quit all at once unassisted due to misperceptions regarding the effectiveness and safety of pharmacotherapy options.7,8 Other barriers include accessibility issues such as lack of time, transportation issues, and cost, especially among the low socio-economic status populations. 9
Digital behavior change interventions (DBCIs) have been gaining popularity and have emerged as a mainstay in the behavior change ecosystem. Previous reviews have already established the effectiveness of DBCIs in promoting the adoption of positive health behaviors.10,11 More recently, given the wide reach and accessibility of mobile and sensing technologies, the use of just-in-time adaptive interventions that aim at providing tailored support at the right time to individuals is becoming increasingly prevalent for supporting health-related behavior change.12,13 These seminal works highlight the necessity for behavior change interventions to adapt in real-time to an individual's changing context and internal state, which is particularly relevant for relapse prevention with risky behaviors such as tobacco use, where behavioral context can change rapidly and unexpectedly. In the context of tobacco cessation, such interventions function in a variety of areas including, but not limited to, delivering tailored content in real-time via mobile apps, providing peer support via online health communities (OHCs), and conversational agents (CAs) via simulated peer advice, lifestyle tips, and programmed education.14,15 CAs are computer-based programs that simulate human-like conversations and use natural language to interact with end users.16,17 They capitalize on the recent advances in voice recognition, artificial intelligence, and natural language processing to extend our ability to provide complex dialog management (DM) methods and improved conversational flexibility.16,17 Previous research has explored the use of CAs for tobacco cessation interventions. One study implemented a CA within social media instant messenger. 18 It showed that user engagement was higher when CA was involved in the conversation, and also users had a higher rate of abstaining from tobacco use when they were involved in conversations with the agent than without it. 18 Another study added a motivational CA within a tobacco cessation application called the Smoke Free app, and the results showed that the users interacting with the CA had higher chances of success during quitting. 19 Calvaresi et al. 20 also implemented CA within Facebook Messenger and obtained similar promising results. One classic example of a commercial conversational text-based intervention designed to help adult smokers begin their quit journey is called Bella. 21 Bella is an AI (artificial intelligence) powered chatbot for tobacco cessation, developed primarily based on expert guidance and was released in January 2018 in the UK. 21
Despite taking on the role of “digital companions,” CAs have their limitations; for example, one of the most advanced commercial chatbots targeting tobacco cessation gets stuck when users input responses that are not prompted. 22 Other barriers to implementing CA within the context of health care are difficulty in understanding users’ perceptions and cultural attitudes, being repetitive and less engaging, and their inability to form personal connections (humaneness) as users would do with their peers or family in real-life settings.23,24 Thus, there is a need for CAs that are (a) data-driven to anticipate conversational turns and intent drifts to provide seamless health communications guidance, which may promote higher user engagement and ultimately provide long-term tobacco cessation support, and (b) theory-informed, grounded in behavioral theory and human communication models as research has shown that theoretical fidelity improves the robustness of DBCIs, making them more efficacious than their counterparts.
Given these research gaps, the specific objective of this work is to develop a methodological framework for the emulation of human-CA interactions that build on social media sequencing. Such empirical grounding will enable us to identify organic sequential patterns in theory and intent manifestation as peers interact in digital social settings to facilitate the design of just-in-time adaptive CA-based interventions to support behavior change. This approach would bridge the abovementioned gaps with sustained user engagement at a more fundamental level by examining the syntactic and semantic turns embedded within online peer conversations. Also, to the best of our knowledge, no CAs have explicitly focused on craving management to reduce the chances of relapse among individuals who have quit tobacco use.
Methods
Figure 1 provides an overview of the methodological framework, which consists of (a) a data modeler, (b) a social media sequencing core, and (c) a scenarios builder.

Overview of the methodological framework for designing a CA.
Their descriptions are provided in the section below. In the scope of this research, we apply this framework to develop a CA for nicotine cravings management to prevent relapse during tobacco cessation. To first understand the critical hallmarks of human conversations in the domain, we leveraged online peer conversations from QuitNet, an OHC for tobacco cessation. 25 QuitNet is one of the most popular OHCs that promotes tobacco cessation, with more than 800,000 users since its beginning in 1997. 25 The community users are predominantly smokers who are preparing to quit or ex-smokers who aim to stay abstinent. QuitNet provides social support to its users via multiple channels (e.g., private emails, threaded forums, and chat rooms). The users are also encouraged to share their quit dates during their forum conversations as a self-reported abstinence signature. Initial studies have shown a strong association between an individual's participation in QuitNet and abstinence, as compared with individuals who do not participate in such a community.25–29
Data modeler
The data modeler facilitates the characterization of thematic preferences, theoretical behavior change constructs, and implicit user needs as manifested in online peer interactions. This understanding has enabled us to emulate content boundaries, response tone, and response content in our CA architecture. We utilized the behavior change technique (BCT) taxonomy 30 to identify manifestations of theory-linked BCTs embedded in online peer interactions. The BCT taxonomy is a cross-disciplinary taxonomy from domains such as psychology, engineering, and behavioral science that provides a foundation for the design and evaluation of reliable behavior change interventions. This taxonomy has facilitated the study of mechanisms of action related to the change in behavior and the evaluation of such components. Effective BCTs have been identified in interventions aiding in tobacco cessation. 31
Previous studies have analyzed speech acts (SAs) to understand users’ general attitudes and state of mind as they interact with their online peers. 32 Some studies have also identified users’ intent to be able to determine the response of the chatbots.33–35 To model the communication context underlying online peer interactions (user's implicit intent), we have utilized a modified version of Searle's speech act theory 36 which helps to describe how humans express themselves during their communication with others using 10 different categories of SAs. The SA theory 36 is a subfield of pragmatics, a branch of linguistics that tries to understand how individuals produce and understand meanings through language. 36
Social media sequencing core
The social media sequencing core identifies the sequential patterns describing the usage of various categories of BCTs and SAs embedded within the conversation threads from a tobacco cessation OHC. This understanding has enabled us to capture changes in the user's context that can impact the expression of BCTs within the responses of the CA. Using the Frequent Pattern Growth algorithm,
37
we identified the underlying relationships or associations that occur sequentially between various categories of BCTs and SAs embedded within the
Scenarios builder
The scenario builder extracts the relevant nicotine cravings-related scenarios from our tobacco cessation OHC. From a total of
Using the subset of
CA architecture design
We generated user intents and responses using the scenarios from the prior step by performing a line-by-line analysis of every message using directed content analysis techniques where each message was chosen as the coding unit for analysis. 41 The textual data of forum messages was first preprocessed using the Natural Language Toolkit (NLTK), and this step included the following tasks: converting text to lowercase, removing punctuation, removing white spaces, removing special characters, and lemmatization. 42 Using these intents and responses, we trained the RASA framework as described below.
RASA is one of the most popular open-source frameworks for building task-oriented chatbots and virtual assistants. This framework makes use of machine learning techniques to recognize the intent of the user, extract entities, execute and action, and manage the flow of the conversation (described below). The architecture and basic workflow of CA is outlined in Figure 2. Once the user initiates the conversation, the user's message is sent to the Natural Language Understanding (NLU) model of the framework; which preprocesses the text from the user's message and then further parses the data to perform two tasks–intent classification and entity extraction. The output of the NLU model is then sent to the DM core model of the framework, which classifies the following action which is appropriate given what has happened in the conversation. It then chooses a response that is sent back to the user based on the list of responses the agent has been trained to return. Using our conversation scenarios from the prior step, we created 12 user intents (of which five were specifically based on the extracted scenarios, and the remaining seven were to support conversations within the agent) with more than 10 training examples for each intent to train the NLU model. We further created approximately 100 responses for training the DM model. We used the default NLU pipeline for training the model (epochs = 100); preprocessing was implemented using the spaCy language model. We further trained the DM model with epochs = 100, and max_history = 5 (memorization_policy). The fallback_policy was executed if the intent classification pipeline confidence was below the threshold value of 0.3; in this scenario, a default fallback message will be provided to the end users (e.g., “Sorry, did not understand”), which would then revert the conversation to the state before the end user's message that caused the fallback to not influence future actions.

Architecture and basic workflow of the CA.
Ethical considerations
This study was exempted from human subjects review by the Institutional Review Board at the University of Texas Health Science Center at Houston (HSC-SBMI-15-0697), thus consent was not required. We extracted only the forum messages that were in the public domain, i.e., peer exchanges that were marked public by the users of the forum. To maintain user anonymity, we de-identified the data obtained from the forum by assigning every community user a unique user identifier. In addition, the researchers had no direct contact with the community users.
Results
Data modeler
The data modeler used was semi-automated in nature, given that we used the manually annotated messages (n = 2005) to train deep learning models and used the best-performing model that resulted in 2.23 million labeled peer interactions spanning from 2000 to 2015. The results from this core are thoroughly discussed in Singh et al. 43
Social media sequencing core
Table 1 presents the top 10 discovered association rules for BCTs and their corresponding support, confidence, and lift values. In our dataset,
Top 10 sequential patterns for BCTs within the obstacles theme labeled peer conversations.
Table 2 presents the top 10 discovered association rules for SAs and their corresponding support, confidence, and lift values. In our dataset,
Top 10 sequential patterns for SAs within the
Scenarios builder
A total of five nicotine cravings-related scenarios were derived using the grounded theory techniques (open coding and constant comparison). 40 The derived concepts, scenarios, and example messages that outline the user needs that will be supported by our CA to help individuals overcome nicotine cravings are described in Table 3.
Derived nicotine cravings-related scenarios, their description, and example messages.
CA architecture design
In the section below, we outline various user intents and responses specific to nicotine cravings-related scenarios that were extracted via scenario builder core. Within each scenario, we also provide the mapping of user intents to various categories of SAs and the mapping of responses to various categories of BCTs (see Figures 3 and 4). For instance, in scenario 1, where users specifically state their longing to smoke,

User intents, example messages, and their mapping to SA theory.

CA responses, example messages, and their mapping to the taxonomy of BCTs.
The BCTs are responsive to the user's intent as captured via QuitNet community peer interactions and are based on the responses provided by successful quitters in the community (see Figure 4). For instance, the responses to the user's intent within scenario 1 are composed of BCTs like
Discussion
In this study, we present an innovative framework for scoping and designing a preliminary communication architecture of a CA. We apply the framework to design a CA to support individuals struggling with nicotine cravings. Through secondary analysis of the QuitNet community's peer interactions, we developed our training data from real-life peer-to-peer conversations and peer mentoring/advice for craving management. We have sequenced the expression of various categories of BCTs and SAs embedded within the
Our dataset revealed that individuals mention nicotine cravings in different contexts; for example, an individual who just quit tobacco use might express different intents regarding tobacco use as compared to an individual who craves after maintaining the quit for a long time. It is necessary to understand the context of users’ needs to make digital tools such as CAs more responsive to the latent unspecified needs of users who struggle with
Some of the limitations of our work include the small sample size to extract nicotine cravings-related scenarios using the grounded theory approach. Such a sample size might have been insufficient to ensure saturation of concepts to derive all possible scenarios related to nicotine cravings. In our future work, we plan to incorporate additional data by scaling the labeling of the online communication themes to a large dataset and using those messages to ensure saturation of concepts for creating relevant nicotine cravings-related scenarios. Secondly, only two researchers were involved in the extraction of concepts and scenarios from the given dataset and thus these scenarios might be limited by subjective bias inherent in the coding process. In future work, we plan to involve multiple researchers in the scenario extraction process to compute inter-rater reliability to achieve a gold-standard corpus of nicotine cravings-related scenarios. We also plan to include interdisciplinary expert reviews to ensure the relevance of the patterns identified using sequential pattern mining algorithms. Another limitation in the current design of the CA is that it might not be able to handle the exception case or problematic scenarios very well; for which we need to generate additional data so that the conversations can be continued with the end-users more productively. In future work, we plan to test and evaluate the quality of responses generated by the CA using the confidence levels (ability to correctly classify the intent from the user's message) reported by the framework as well as a manual review upon feeding previously unseen nicotine cravings-related messages to the CA.
Conclusions
The technological advancements facilitate the use of AI-based CAs in the healthcare domain. This study describes our efforts to define a preliminary architecture of a CA whose goal is to interact with individuals as they report struggles with nicotine cravings. Our work builds on data insights and pattern mining of peer interactions among active and abstinent tobacco users which enables us to model user, behavior, and environment contexts. This deep and naturalistic understanding allows us to emulate guided interactions with a CA with the ultimate goal of reducing their chances of relapse. Specifically, the utilization of pattern mining algorithms to model peer messages grouped at the topic level is essential to simulate CA interactions, thus shifting the unit of analysis from single messages to threads of conversations. Our study provides insights into the implicit needs of individuals through consideration of the expression of content in social media interactions and how those needs can be addressed through appropriate responses grounded in behavior change techniques in a CA interaction. Such theory-informed and data-driven CA interactions may prove to be more effective for the management of nicotine cravings, relapse prevention, and long-term sustenance of positive health behaviors.
Footnotes
Acknowledgements
The authors would like to thank the members of the Center for Digital Health Analytics and UTHealth Houston-Cancer Prevention Research Institute of Texas for support and assistance throughout this study.
Contributorship
TS and SM researched literature and conceived the study. TS and MT were involved in data analysis. TS wrote the first draft of the manuscript. All authors reviewed and edited the manuscript and approved the final version of the manuscript.
Declaration of conflicting interests
The author(s) declared no potential conflicts of interest with respect to the research, authorship, and/or publication of this article.
Ethical approval
This study was exempted from human subjects review by the Institutional Review Board at the University of Texas Health Science Center at Houston (HSC-SBMI-15-0697).
Funding
The author(s) disclosed receipt of the following financial support for the research, authorship, and/or publication of this article: Research reported in this publication was supported by the National Library of Medicine and National Cancer Institute of the National Institutes of Health under award numbers 1R01LM012974-01A1. TS is supported by UTHealth Houston-Cancer Prevention Research Institute of Texas Innovation for Cancer Prevention Research Pre-Doctoral Fellowship (Grant #RP210042). The content is solely the responsibility of the authors and does not necessarily represent the official views of the National Institutes of Health or the Cancer Research Institute of Texas.
Guarantor
SM.
