1 Introduction

In the past decade, a significant development of translational medicine systems has been observed. The role of translational medicine primarily involves identifying diseases “at early stages” [1] in order to prevent them from transforming into more complex cases. The implementation of translational medicine in the context of research is oftentimes connected with testing new hypotheses, understanding the mechanisms of the human body functions, and genesis of an illness.

The implementation of systems and services for the needs of translational medicine most often entails significant costs related to equipment, staff competence, and supporting systems of interaction with potential and actual patients in medical institutions.

A considerable share of costs is borne by medical institutions due to the interaction with patients for the following purposes: defining the patient by a doctor; making appointments with the doctor; consultations; and systematic screening of the health state and individual organism indicators. These interactions also refer to the procedures of outpatient medicine [2].

Solving this problem as well as implementing translational medicine in the economic framework of clinical practical work is possible through changing the technological platform for fulfilling the aforementioned business processes. The development of information technologies over the last decade, referred to as the new information technologies (NIT), has led to a boom in research and development in the field of digital business transformation [3].

Scrupulous attention is paid to the study of changes in a broad range of business processes within companies which are driven by the corresponding technological innovations. Solutions that boost the efficiency of customers’ interaction with the company are set aside as a separate type of drivers [4].

The issues of electronic CP interaction systems have been addressed in recent years in the context of e-mail interaction [57]. However, at the present stage, a growing rate of communication is performed through smartphones given their permeation in everyday life [8, p. 2]. At the moment, a large number of different sorts of interaction by means of mobile technology and smartphones is being engineered [9, 10] involving sending various data on tests performed by the patient themselves [11, 12] including translational medicine purposes [13, 14].

However, the number of people who use smartphones with mobile apps as the quickest way to interact with medical institutions tends to decrease due to insufficient RAM on smartphones and, as a consequence, these apps being deleted to optimize the memory space. The main problem with smartphone applications is their short-term lifetime on smartphones. In this light, it should be noted that messenger applications happen to be the most commonly used apps with a record-breaking data lifetime [15], for example, WhatsApp messenger has accumulated over 1 billion users [16].

According to experts, the time the average subscriber spends using those apps has greatly exceeded the total time the subscriber spends on conversation. The advantages are as follows: wide coverage, high readability, permanent online mode and synchronization [17, p. 398], and direct contact during conversation [18]; which allow delivering a message to the subscriber and waiting for their reaction, binding to the smartphone resulting in a flexible system of personalization and subscriber binding to the database. Therefore, the migration of the site services and mobile applications to messengers is a logical step to take.

One of the options for a possible migration of the site services and mobile applications is the use of chatbot systems. The chatbot technology is a “machine conversation system that communicates with the person by means of natural spoken language” [19, p. 489]. Dialog between human and machine has been discussed earlier in scientific publications [20, 21], the most well-known being MegaHAL [22], Converse [23], Elizabeth, and Alice [24]. The work of Victoria Rubin [25, p. 505–508] gives an overview of the use of chatbot systems in libraries with the description of the functions served by these systems, namely, educational, informational, assistive, and socially interactive.

There are a number of descriptions coming in for chatbot systems that enable CP interaction. The work of Marcel et al. [26, p. 158, 159] describes a chatbot system used for contactless communication with patients suffering from cystic fibrosis in order to control the progression of the condition and maintain strict compliance with all the prescriptions given by an attending physician. The authors confirmed that the proposed system increases the number of patients adhering to all the medical prescriptions, reducing the risk of infection transmission to patients and increasing the effect of the treatment. In the work by Crutzen et al. [27], the chatbot system promotes the healthy lifestyle concept among adolescents. The study showed the effectiveness of using a chatbot to communicate with adolescents on the subjects of sex, alcohol, and drugs. Adolescents communicate with a chatbot on a larger range of topics with the frequency and duration of contact going up. The results of the survey performed among 929 adolescents indicated that the advantages of the chatbotsystem are as follows: laconism, anonymity, ease of use, and speed.

Besides the examples of chatbot system implementation in traditional medicine practice, we have failed to find works mentioning the use of chatbot for translational medicine. The present article proposes a model of the chatbot system structure and software tools which allow its integration to a messenger for the goals and objectives of translational medicine and outpatient medicine. The model of chatbot system, earlier used for commercial projects development, was proposed by Textocat company.

2 Proposed Model of Chatbot System and Software Tools for its Implementation

Textocat company has developed a chatbot system that is considerably different from traditional chatbot systems based on a system of rules [28], using an electronic companion algorithm developed by Agostaro et al. [29, p. 381] as a counselor bot [30] and a data provider bot [31]. The chatbot system also uses the Telegram messenger, which became possible due to the development of Java Telegram bot API.

Figure 1 shows a diagram of the organization of the chatbot system in the Telegram messenger under development of Textocat company:

  • ChatbotActor is a core module that conducts user sessions, during which, depending on the internal state and incoming events; it implements behavior scenarios based on the behavior function and internal data. Actor module is formed using java and supplementary libraries: (1) Akka Java to organize the core of Actor system model [32], (2) ElasticSearch Java API for the interface of the program with the ElasticSearch index [33], and (3) Java Telegram bot API for the interface between the program and the Telegram messenger and the implementation of a user interface [34]. The Actor system is an actor space with each module being declared as a separate actor with respect to the idea of reactive programming patterns [35].

  • Client data includes a user database, user personalization, and internal data affecting the behavior of a particular scenario session. In certain scenarios, the application is supposed to record the information, obtained from the patient, into their profile. This option provides large opportunities for polling patients and potential patients for the tasks of outpatient medicine. At that, some scenarios implying polling can be used for translational medicine, for example, in order to collect information about the patient’s behavior and to further compare this information with the translational medicine data in prognostic models. For example, those can be polls on behavioral patterns [36], which can significantly broaden the arsenal of prognostic models in translational medicine.

  • Question/Answer Index is a search index, bot knowledge-base, which performs the function of search of responses to user’s questions together with the search engine. The question-reply index is formed using the processed real client-consultant dialogs. The system identifies clients’ needs through frequency of question appearance as well as the most relevant consultants’ reply. The question-reply chain is processed by MyStem provided by Yandex technology, a morphological analyzer of the Russian language that can filter out morphological ambiguity [37, 38]. Stop words are eliminated [39], and a bag of words is formed; after that, a question vector is formed by Word2vec algorithms, which is a group of related models used to produce word embeddings [40]. Each word is transformed into a vector and multiplied by the weight of the word IDF (Inverse Document Frequency). The vectors obtained are summed up, which allows further faster indexing and tracing of particular words and sentences.

  • Text data is a body of text documents based on which the bot knowledge-base is formed. The call center logs and question-answer database that covers frequently asked questions are expected to have over 10,000 dialogs from user session logs from a partner clinic. Generally, they are patients’ referrals to consultants on issues they seek an answer to, clarification of questions contexts and consultants’ answers, information on the clinic, and services and advice as to what expert to refer to.

Fig. 1.
figure 1

A diagram showing the organization of a chatbot system

The program modules are placed in a server (bot server, Fig 2). When bot server is started, Actor System is initialized together with the main modules of Telegram Handler, Session Manager, Bot Actor, Response Manager, Catalog Service, Question-Answer Service; after which, Telegram Handler is authorized in Telegram by means of a bot token and starts to await a message from Telegram. When a user initializes a dialog with the bot, Telegram Handler receives the messages and sends them to Session Manager which is responsible for holding the session with the user. Each session represents an initialization. Bot Actor implements behavior scenarios based on the behavior function and internal data, and then Bot Actor processes the received message and implements one of the behavior scenarios and redirects the data to form a message to the user in Response Manager which forms and sends a reply message from the chatbot to the user.

Fig. 2.
figure 2

Pattern of the chatbot system functioning

When there is an information request from the user, Bot Actor interfaces with Catalog Service that in turn interfaces with the database of the program and searches based on the document index.

When implementing scenarios of bot replies to the user’s questions, Bot Actor interfaces with Question-Answer Service which is responsible for interfacing with the question-reply index. The question of the user is also transformed into a vector, and a search as per the question-reply index is initiated based on the Cosine similarity of the request vector and the question vector.

3 Conclusion

The chatbot system structure presented in the paper contains the basic modules and tools for their implementation. The presented model of the chatbot system must provide an opportunity to develop CP and DP interaction at the level of outpatient medicine and, more than that, at the level of translational medicine. This became possible due to the variety of information gathering tools, e.g., configured rules and scenarios, digital questionnaires, and the collection of information through m-health applications which can be used here. The synthesis of the chatbot system with a data collection module (m-health data collection and questionnaire) can significantly expand the realm of possibilities for translational medicine in the following processes: (1) surveys—evaluation of the patient’s health condition through a list of questions and dynamic tracking of the patient’s condition (state of health, tests, and medication regimen adherence); (2) personal reminders/alerts—a reminder of the necessary procedures, adherence to the medicine regimen, doctor’s appointments, alerts about test results, or the need to visit a doctor; (3) chat with the doctor/consultant, remote communication between doctor and patient through chat, and initialization of patients’ referrals to a consultant; (4) appointments for consultation/medical procedures—making doctor and medical procedure appointments remotely through the chat interface; (5) m-health data collection from apps and customization. Patients will be able to undergo a number of diagnostic procedures remotely in the future given the rapid development of m-health systems and biomarkers in translational medicine; 6) the chatbot system can transmit the results of prognostic models to the patient on request, taking into account the parameters of their behavioral patterns (nutrition, physical activity, etc), for them to adjust their behavior to the preset target indicators.

Artificial intelligence elements underpinning the chatbot technology will automate a number of processes in translational and outpatient medicine, simplify interaction in routine operations, and provide instructions and relevant information to patients. Ideally, clinics will be able to continuously monitor the health state, behavior, opinion, and other information of patients. The gathered information will further be processed for outpatient routines at clinics as well as for identifying the parameters of deterministic models in translational medicine.