**2. Features of chatbots considering healthcare domain**

The WHO [20] defines PHC as *a whole-of-society approach to health that aims at ensuring the highest possible level of health and well-being and their equitable distribution by focusing on people's needs and as early as possible along the continuum from health promotion and disease prevention to treatment, rehabilitation, and palliative care, and as close as feasible to people's everyday environment*. In this direction, as recommended in Ref. [8], PHC is a combination of public health, medical care, and social assistance, which is essentially anticipatory in nature, and includes actions in different aspects

such as health education, food and nutrition, environmental sanitation, maternalchild health, immunizations, prevention and control of endemic diseases, treatment and control of the most frequent diseases, and provision of essential medicines. Under the PHC policy, this analysis of the impact of environmental, physical, demographic, epidemiological, congenital, economic, and social factors is essential for the provision of person-centered health services, taking care to maintain the focus on the prevention and promotion of health before it becomes disease.

In the context of personalization of healthcare, service value-based care models are expected to use persons and patients context, to improve multiple health conditions of patients and populations [7]. Within cognitive computing applications, developments with multiple uses are identified. As Improta et al. [21] explain, a patient can be used both as a decision support system for medical specialists in the phases diagnosis and treatment and as a monitoring system of the clinical environment in health establishments. The use of these cognitive systems also encompasses digital therapies focused on dream therapy [22], the use of a gaming approach for depressive events [23], and treatment of depression and anxiety [24] of both the young and the elderly [25]. AI-based chatbot systems, due to their characteristics of acting as automated conversation agents, play a central role in various health actions, since they can promote health, by providing education and potentially causing behavioral changes. This is observed in the treatment of adolescents with a chronic medical condition using a text messaging platform (chatbot) with written interactions to increase engagement and deliver educational content [26].

On the one hand, the first contact functions, whether they are collective actions or toward the person, usually begin with the exchange of information between people and health personnel, whether they are doctors, nurses, or health promoters, which is essential for developing action plans for healthcare. Such data collection and its corresponding registration in the institutional systems take time, which, if automated and systematized, could increase the effective consultation time for patient management [2]. In this direction, chatbots interact with patients for specific, short, repetitive, and massive tasks. Rule-based chatbots represent great potential for prevention and health promotion tasks [27].

On the other hand, the use of chatbots that interact with patients through natural language processing, can, in addition to obtaining information from patients, perform iterative data collection based on previous responses to build clinical histories and contexts of health conditions [14]. So, health service providers, whether public institutions or private providers, can strengthen their technological instruments with chatbots that perform these basic tasks of collecting information or disseminating healthy practices and training in self-management of people's health. Thus, the information built can be used both for the personalization of responses for patients and for guidance and promotion on services of greater complexity or specialization required by people.

A fine-trained chatbot that includes capabilities for consultation, knowledge gathering, basic reasoning, and giving feedback can accomplish this guidance task, simulating a health professional. Development frameworks that integrate questionand-answer reasoning mechanisms based on a domain-specific knowledge base can achieve this [28]. Chatbot applications in health, in addition to primary care, have covered marketing and research topics. Such is the case of pill reminders, interviewing smoking habits, dietary behavior, and physical activity and even for extraction system to extract mentions of adverse drug reactions from the highly informal text in social media. Also used are voice agents for chronic illness monitoring, medical

#### *A State-of-the Art Survey on Chatbots Technology Developments and Applications in Primary… DOI: http://dx.doi.org/10.5772/intechopen.110847*

counseling and education, clinical decision support systems (CDSS) for diagnosing infection diseases, and assisting medical personals in diagnosing internal conditions for patients based on larger collection of hospital case records [28]. These agents can offer a wide range of problem-solving functions that can integrate multiple tasks from natural language understanding and knowledge base query to reasoning and giving feedbacks, through an iterative inquiry process. Currently, there is a wide range of applications for chatbots aimed at mental health, health education, maternal care and sexual and reproductive health, nutrition and physical activation, sleep disorders, support in emergency situations for chronic diseases, management of respiratory diseases and accidents, increase in self-care, and transitions in stages of risk for vulnerable groups [13, 26].

It is important to note that over the past few years, different categorizations of conversational agents have been developed including both text chatbots and voice chatbots. Some also consider the channel on which they are used, whether *via* smartphone, web, or some additional platform where it is used. They can also be classified by the objective they fulfill, whether they are aimed at a function or a specific general-purpose task [5, 29]. However, as suggested in Refs. [5, 30], it is more common to classify the logic approach of the dialogue management system that interacts with user input using a knowledge database to determine the action to be taken in the conversation flow.

Recent literature review studies have observed that the large majority of mentalhealth oriented chatbots currently in existence do not use machine learning at all, favoring more stable and predictable techniques such as rule-based modeling [2, 31]. However, findings have been presented that indicate that the perception of some users generates a lack of expectation that they will reach a state of development where they will displace the work of health personnel [12]. The most used chatbots in health applications are rule-based; they use a decision tree on a specific condition to define the rules on which the chatbot carries out the flow of the conversation, choosing how it responds to each user input. So, the complexity and resolution of the chatbot depend on the programming logic and the complexity and depth of the rules with which it has been defined. For this reason, these chatbots cannot learn from user conversations or interactions and are limited to the scenarios for which they have been programmed [27]. These chatbots are also part of the dialog systems known as specific task or closed domain that manages to perform tasks specific to a domain such as technical assistance and customer service [29].

*Knowledge base-based chatbots use structured data sources that contain knowledge of a specific function (such as frequently asked questions or FAQs) to make that information accessible to users and deliver relevant content. In this way, this type of chatbots uses keywords and functions connected to a knowledge base of multiple databases and data sources* [30]. These application-specific domains usually have limited availability of training data. They include linguistic-based approaches, where the user's questions are converted from natural language into a database query, and the identified answer is presented to the user [28].

In dialog systems, the knowledge-based chatbots are known as open domain's retrieval base models since they select a response from a previously constructed repository. This is the complement of generative models, which produces new responses [29]. The open-domain dialogue systems require large amounts of data to train and often allow effective chatbots to be created, even though they cannot perform effectively on specific tasks, and often cannot query databases or add useful information to their chatbots' answers [32]. Nevertheless, information retrieval, knowledge base

or NLP, and systematic literature reviews have classified the techniques, algorithms, frameworks, and tools observed as a combination of the one or more of these technologies: Deep Neural Network, Graph Based Lemmatization, LSA, Multi-Document Summarization Naive Bayes, Named Entity Recognition, Parser, POS Tagging, Relation Finding (Similarity Distance), Shallow Syntactical, Stemming, Support Vector Machine, Text Chunking, and Tokenization [30]. For open-domain neural dialog generation, methods are categorized and examined as a variety of main categories such as Reinforcement Learning (RL), Hierarchical Recurrent Encoder-Decoder (HRED), Generative Adversarial Networks (GAN), Variational Auto-Encoder (VAE), Sequence to Sequence (Seq2Seq), and Pre-training Model [29, 30].

For the chatbots that have been built based on machine learning and AI, the first developments used single-layer representations that were appended through the use of word vectors applied for task-specific architectures. Subsequently, recurrent neural networks, RNNs, were used that increased the number of capable representations including context analysis to achieve better results in architectures for specific tasks, until recent advances based on pre-trained recurrent or transformer language models such as ChatGPT, which no longer uses specific architectures [33].

#### **2.1 Healthcare applications uses, evaluation, and acceptance**

Paradigm shifts from the medicalized approach to seeking health systems that focus on the patient and not on the disease are driving the need to readjust the structure of health systems to improve access to health services, not only for a more diverse population but also for systems that are aware of individual differences and people's health contexts. This implies that through these technological advances, the health needs of each person in their context and based on their social determinants are the ones that predominate in the access criteria used by intelligent health systems [34]. This implies that each dialogue system development focused on the different health conditions, especially those that are linked to each other and multifactorial conditions, must work together to offer healthcare services supportive complementary technological and clinical personalization that allows offering a robust experience to people who seek healthcare services. However, before their incorporation into health systems and routine clinical practice, it is essential to review the effectiveness of these technologies, in such a way that there is a clear understanding of under which contexts these tools can be used. This includes understanding the frame of reference; technological, ethical, and clinical evidence; and adaptation to specific populations, among others, which must give support and certainty to the developments, as well as understanding the limitations, biases, good practices, evaluations, and contexts of use [13].

The adoption of chatbots integrates different actors and functions within health systems. Health professionals have systematized the data collection, the appointment schedule, and the dissemination and training of patients for self-care of health and the increase of health literacy. These have proliferated in mental-health and primarycare applications for low complexity actions. Health units are exploring the capacity of chatbots for functions of health education and counseling support, assessment of symptoms, and assistance with tasks such as patient intake process, scheduling, and collecting personal and family histories [2, 28].

Health systems have combined the chatbots with decision support systems to prioritize targets during the pandemic, assess drug side effects from electronic medical records, disseminate information on available health resources, and Management

#### *A State-of-the Art Survey on Chatbots Technology Developments and Applications in Primary… DOI: http://dx.doi.org/10.5772/intechopen.110847*

of installed capacity in high demand situations [2, 28]. The evaluation of chatbots and the dialogue generation system (DSG) is still in early stages, and the evaluation methods are incipient, even though the conversational AI global market size is expected to grow at high rates, increasing the value by 2025 [35]. Thus, there are research lines on adaptations of automatic metrics to evaluate the responses generated, such as bilingual evaluation understudy (BLEU), Recall-Oriented Understudy for Gusting Evaluation (ROGUE). In addition, human evaluations and combinations between them have been used. Even given the different architecture and logic configurations in the dialogue management systems that govern chatbots, humans have been used to assess consistency, fluency, coherence, and informativeness [29, 32].

Different works have been carried out to categorize chatbots using their health context and core features, as well as their NLP capabilities. The type of user targeted, personalization, data acquisition for implicit or explicit personalization, domain areas of health, theoretical and therapeutic support, security, and privacy also have been studied [2]. In the evaluation of chatbots, some aspects have been described by authors such as if chatbot is programmed to support people, patients, health professionals in tasks. Some studies include satisfaction surveys with a Likert scale as well as measures of the interactions between chatbot acceptability, perceived symptom severity and stigma [3, 12]. There are also other technical characteristics linked to other aspects of the system such as the content, the user interface, the channel of use, and functionalities that are evaluated such as irrelevant answers, frozen chats, and messages in non-readable linguistic structures that make them nonfunctional [2].

#### **2.2 Acceptance**

Chatbots may be useful for sensitive health issues in which disclosure of personal information is challenging, since Chatbots were seen as least acceptable as a consultation source for severe health issues, while the acceptability was significantly higher for stigmatized health issues [2]. There are studies that explore the use of chatbots, smartphones, text messages, and social networks to provide tools and resources to help in psychological transitions, more frequently oriented to specific age groups (adolescents), where the motivations for using health chatbots are explored, in order to predict their acceptance [36]. Some studies report difficulties for chatbot users to understand how they work, suggesting that there may be difficult concepts to understand and that their acceptability may depend on different aspects such as expectations, favorable conditions for their use, social influence, habits, associated costs, and even access to the health system [12].

Some works point out the concerned the ethical implications as the main obstacle to the adoption of these technologies in the treatment of addictions. Some of these are using a nonhuman agent in a supportive role, giving answers contrary to the intention of the users, giving sensitive information to enhance the effect of medications through explicit indications, or even the potential for causing harm to specific populations [3, 18]. Although many countries are developing and using chatbots as app interfaces focused on treating health conditions, during the COVID pandemic, different coordinated efforts were made between industry, governments, and nongovernmental actors to integrate communication strategies to reach millions of users. This was achieved by different approaches and uses to collect and disseminate information on patients, the virus and the situation of health systems, diagnostic support, guidance on conversions of health systems, and vaccination strategies and carry out telehealth actions [14, 37–39].

It should be remarked that technological advances toward precision-driven healthcare, which promotes the application of data science, in particular technologies, such as interactive cognitive systems, artificial intelligence, and machine learning, are aimed to enhance healthcare provision, to solve the patients' personalized demands more accurately and, at the same time, more easily to the service providers. In this direction, many chatbot technologies are still to integrate the health condition-monitoring continuum since they are still task specific, by health condition, environment, or agent [7].
