JOIV : Int. Inform. Visualization, 8. : IT for Global Goals: Building a Sustainable Tomorrow - November 2024 1625-1634 INTERNATIONAL JOURNAL ON INFORMATICS VISUALIZATION INTERNATIONAL JOURNAL ON INFORMATICS VISUALIZATION journal homepage : w. org/index. php/joiv Rule-Based Chatbot for Early Self-Depression Indication: A Promising Approach Wan Nurhayati Wan Ab. Rahman a,*. Nurul Munirah Abdul Hamid a Faculty of Computer Science and Information Technology. Universiti Putra Malaysia. UPM Serdang. Selangor. Malaysia Corresponding author: *wnurhayati@upm. AbstractAiDepression is a prevalent mental health condition worldwide, often characterized by persistent sadness, loss of interest or pleasure, and feelings of worthlessness. Depression is the leading cause of mental health issues worldwide, and it is becoming more severe without self-awareness, early screening, and further medication. Early detection and intervention are critical in mitigating its adverse effects. Leveraging advancements in Artificial Intelligence (AI), particularly in Natural Language Processing (NLP), chatbots have emerged as potential tools for early depression indication. Chatbots are beneficial tools in the mental health domain, such as in assisting mental health risk users. This paper presents the development of a rule-based chatbot aimed at detecting early signs of depression through conversational interactions by screening symptoms of depression. Predefined rules are developed to ensure the assessment can generate reliable results. The rule-based chatbot is developed to assist in depression indication assessment for mental health-risk individuals at an early stage and provide the risky patient with appropriate support and resources. The chatbot assessment has adopted the Depression Anxiety and Stress Scale 21 (DASS. Based on the System Usability Scale (SUS) results, the rule-based chatbot has been accepted by all 30 respondents with good acceptance of an average SUS score of 77. Thus, the outcome of this chatbot can be utilized as a professional platform to encourage self-disclosure of mental depression indications for users, and it can be beneficial as the initial reference before recommending further action before the earlier help-seeking. KeywordsAiDepression. early indication. rule-based chatbot. predefined rules. self-depression indication. Manuscript received 5 Mar. revised 9 Jun. accepted 18 Sep. Date of publication 30 Nov. International Journal on Informatics Visualization is licensed under a Creative Commons Attribution-Share Alike 4. 0 International License. (COVID-. 3%). Moreover, other reasons . 8%) include health, job performance, interpersonal relationships, and intrapersonal issues . The COVID-19 pandemic and the Movement Control Order (MCO) around the globe have impacted most non-essential services. cannot be operated as usual. Consequently, many people have lost their jobs and been in financial crises. In addition, the COVID-19 pandemic has had a significant impact on mental health . Digital Mental Health Intervention (DMHI) is an initiative that raises awareness of mental health issues. From the perspective of mental healthcare professionals, the chatbot can help support people with mental health issues . The researcher reported that the chatbot's acceptability is rated as high in the mental health domain . DMHI is promising in addressing gaps in mental health service provision. However. DMHI drawbacks have been reported, such as the existing application's lack of scientific evidence about its efficacy, pending replication, inability to understand the content and context of usersAo input correctly, and the Artificial INTRODUCTION Depression is the primary cause of poor health and disability worldwide. As per the most current evaluations from the World Health Organization (WHO), approximately 280 million individuals are presently living with depression . The crisis of mental health is expected to be the second highest in Malaysia. The study conducted by the Ministry of Health Malaysia revealed that every ten adults aged 16 years old and above suffer from some form of mental illness . The suicide rates increased significantly for males between 2014 and 2019 . Depression can be the cause of loss of job and unemployment . , job stress, workload, burnout . , unstable finances . , and family problems . addition, recent statistics on the factors affecting work-related depression, anxiety, and stress among fresh graduates in Malaysia caused remarkably by job demand or workload . 6%), working hours . 4%), working environment . 4%), salary . 1%), and coronavirus disease 2019 Intelligence (AI) chatbot's inability to generate a relevant Progressive and advanced technology like chatbots has increased in many domains, moving from traditional to digital platforms to assist users. Chatbot is an automated program designed to interact with users in a human-like manner. It typically requires minimal or no cost to use. It can be available at any time of day or week, regardless of time or physical location. This makes it an attractive solution for many fields and domains needing more staff or financial resources to maintain 24/7 human support. The most commonly cited motivational factor is productivity, with the chatbot providing timely and efficient help or information . The use of chatbots in the healthcare sector has grown, with these systems designed to deliver customized health and therapy information, provide patient-related products and services, and offer diagnoses and treatment recommendations . Chatbot can care for the userAos emotional health . In addition, the chatbot also can remind patients to take their pills . Thus, the chatbot has the potential to be used to assist users having mental health issues . , . , but not to replace mental health professionals. In this study, we focused on the benefits of a rule-based chatbot for indicating depression in individuals as early as possible. This paper is structured as follows: Section 2 reviews the material used to indicate depression and chatbot potential for mental health and highlights the research methodology Section 3 discusses the outcomes of the rule-based chatbot in assisting people at risk. Lastly. Section 4 concludes the benefits of a rule-based chatbot for early self-depression oriented factors. Besides, women may experience specific forms of depression-related conditions, including premenstrual dysphoric disorder, postpartum depression, and postmenopausal depression and anxiety . The Instrument Tools to Indicate the Prevalence of Depression The presence of depression can be detected using the existing instrument tool in mental health. The existing instrument tool consists of a set of questionnaires such as the Malay Depression Anxiety Stress Scale (DASS. , . , . Maslach Burnout Inventory . Patient Health Question 9 (PHQ-. , . , . Beck Depression Inventory (BDI) . , . , . WHOQOL-BREF . , . , . Whooley Question . General Health Question (GHQ-. , and Administrative Stress Index (ASI) . However, not all instrument tools are applicable for users of all ages and are relevant for specific conditions. Recent studies found that PHQ-9 does not give an accurate result to estimate due to the overestimated prevalence of depression . In contrast. PHQ-9 is widely validated, but it was recommended to have two stages of screening . There was a suggestion that mental health professionals share their opinions in supporting mental health issues. Based on surveys conducted from 2010 to 2021. DASS21 was the popular instrument used among Malaysians. DASS21 has three components: depression, anxiety, and stress. It is reliable and valid for Malaysians because it provided robust data based on the largest sample size for construct validity . However, the instruments were used for different Recent studies claim that the combination of the instruments was used to detect depression . For example, a combination of instruments such as DASS21. Hospital Anxiety and Depression Scale (HADS), and GHQ12 was used to assess usersAo experiences of anxiety to achieve accurate results. Technology intervention is growing in the mental health DMHI's focus on depression was reported in literature reviews such as mobile apps . , webbased . , telemedicine . , and AI chatbot . However, there are drawbacks found in the previous work, whereas DMHI is not applicable for all users due to choppy movement and delay in audio . in telemedicine, some adolescents felt using the web-based system did not help them and required some time for loading . most of the currently available apps lack scientific evidence regarding their efficacy, including pending replication studies . without the capability to accurately grasp the content and context of a userAos input, a chatbot cannot produce a relevant response . In addition, the counseling unit within the organization has a web-based system to communicate with people in need. For example, counselors at public universities can do depression assessments by completing the assessment tool. For instance. Universiti Putra Malaysia (UPM) provides assessment screening questionnaires based on a mental healthcare instrument called DASS21 . The result will be displayed after the user has entered all the compulsory information, such as demographic and contact information. The counselor will contact the user for an appointment if necessary. The user II. MATERIAL AND METHOD Mental Health Issues and Scenario Depressive disorder, also known as depression, is a common mental disorder. it can happen to anyone. Depression is one of the mental illness issues that could influence how people think, feel, and behave. It is related to someone who has unstable emotions such as sadness for a prologue period, and it can disturb routine daily. The mental health issue has garnered more attention recently, particularly to the riskiest people who are living a challenging life after the coronavirus disease 2019 (COVID-. The issue of mental health, such as mental illness, can be categorized into a few groups, such as schizophrenia, mood disorder, bipolar disorder, and depression . Depression can be categorized into levels such as everyday, mild, moderate, severe, and extremely severe. Worse scenario, it can lead to suicide attempts if there is no solution to control depression. Ministry of Health Malaysia has recorded 1,080 suicide attempt cases between January and December 2020 . The findings surprisingly showed how severe depression is among Malaysians. Research claims that women tend to have depression rather than men due to biological factors and exposure to women to depression . Depression is affected differently for both. women express internal symptoms while men express external symptoms. A study of dizygotic twins found that women were more sensitive to interpersonal relationships, while men were more responsive to external career and goal- must bring a hard copy of the assessment result during the appointment session. Besides, private psychiatric companies also use web-based systems to provide depression assessments. The user must enter all compulsory demographic information such as gender, race, education level, age, marital status, and occupation before assessment. The web-based system then generates the result once the evaluation is completed. This web-based system provides general information such as when to see a doctor, the signs of depression, general information about anxiety, the hospital, and the contact number to make the appointment at a private clinic. However, the system is less interactive, and some information needs to be updated. Web interactivity is the interactive feature embedded in a website that offers information exchange between the user and the web. It is one of the essential elements to create a good experience for users and attract them to use the system. some studies, chatbot-based assessments that use rule-based techniques could provide highly engaging, create bonding between chatbot and user, and effectively collect anonymized mental health data among employees . Once the assessment is completed, participants will receive their results and recommendations. For example, an overall report will be presented to the company to assess the level of mental health conditions among their employees. Thus, the company could offer valuable insight and recommend further campaigns to increase awareness about mental health This has been seen as an approach to improve mental health issues . A rule-based chatbot classifies the text and generates an appropriate response for the user by using pattern-matching . The user inputs a sentence . and generates the corresponding output . Consequently, it will use the pattern-matching algorithm to compare user input to a rule pattern and select a predefined reaction from a set of Artificial Intelligence Markup Language (AIML). Chat script, and River script are the most popular languages for implementing chatbots with a pattern-matching approach . An AI chatbot employs machine learning technology to comprehend the context and intent behind a question before crafting a response. AI is increasingly becoming part of our daily lives by developing and using intelligent software and hardware, known as intelligent agents or chatbots . It is a computer application programmed to learn and form replies based on the previous data from the user. The earlier data collection will be a knowledge for the chatbot to respond to the user, which can be collected by training the chatbot. Without proper training, a chatbot is forced to be shut down because it can cause people to interact with the bot inappropriately, using offensive language and content . A chatbot is created for a particular purpose. How it operates depends on the chatbot type, either a rule-based chatbot or an AI chatbot. A rule-based chatbot can only comprehend the limited set of options it has been taught. The predefined rules govern chatbot conversation. A rule-based chatbot is typically simpler to develop, using a simple truefalse algorithm to comprehend user queries and provide pertinent responses. On the other hand, the AI chatbot is equipped with a synthetic brain. It has been trained using a machine learning algorithm and can comprehend free-form queries. Not only does it comprehend commands, but it also comprehends the language of nature. As the chatbot gains knowledge from interacting with users, it continues to advance. The AI chatbot recognizes the user's language, context, and intent and responds accordingly. Chatbots can range from basic programs that provide single-line answers to more advanced digital assistants that learn and adapt to offer increasingly personalized responses based on the information they collect. As the use of chatbots continues to grow across various fields and domains, developers are prompted to create these systems within tight timeframes and with limited initial knowledge. Consequently, there is a high probability that the chatbot will fail. The researcher conducted a short survey about the failure to raise the state-of-the-art chatbot. The result showed a need to realize how chatbots are currently being used and designed and their primary sources . Thus, the development of chatbots requires in-depth knowledge of the userAos motivation for using the technology, which allows the practitioner to overcome challenges regarding adopting the technology . Moreover, general knowledge is needed to understand the relationship between humans and chatbots. Therefore, practitioners should have knowledge and clarity about stateof-the-art chatbots to minimize failure and facilitate better human-chatbot interaction experiences in the future . The state-of-the-art refers to the fundamental concept of a chatbot and the design technique applicable to it, such as the Chatbot to Benefit Mental Health Domain A chatbot is a computer program designed to interact with human users through spoken, written, or visual language. Chatbot can benefit users such as 24/7 availability, automation of operations, reduction of human errors, learning and updating, management of multiple users, and customer it is being utilized in a variety of domains, including business, customer services, education, healthcare, mental health, and others. Chatbot has the potential to be helpful in the treatment of mental disorders, particularly for those who are unwilling to seek mental health advice for fear of discrimination or negative perceptions of those who see them as having mental health issues . Chatbot evaluation needs to be addressed in the literature . and assessing and comparing different chatbot systems in terms of effectiveness, efficiency, and user satisfaction is challenging. Most researchers reported that the usability evaluation concentrates on user satisfaction . , . , . Digital mental healthcare has the potential to bring more access, especially to mental healthcare provision . Online survey results indicated that over half of the participants believe chatbots can support mental health from a professional perspective and that there are benefits associated with mental healthcare chatbots . Moreover, chatbots can act as intermediaries, encouraging individuals to engage in deeper self-disclosure with an actual mental health professional . There are two types of chatbots: rule-based chatbots and AI chatbots. Rule-based chatbots, or decisiontree bots, use a series of defined rules. classification of a chatbot, components of the chatbot, and technique used by the chatbot . More attention is needed to evaluate chatbots to prevent them from harming users. Usability is one of the key areas in software quality, and evaluation is needed to ensure that chatbots achieve effectiveness, efficiency, and satisfaction according to the ISO 9241-11 standard. relationship among the chatbot's components. It displays a three-tier structure comprising the presentation, application, and back-end tiers. Research Processes and Activities Research methodology describes the research processes and activities following four main phases, as depicted in Fig. Phase 4 Evaluation Tool Fig. 2 Conceptual diagram of the chatbot development Phase 3 Phase 2 Phase 1 The presentation tier is the user interface, allowing the interaction between the user and the application. It can be presented using a web browser as a desktop or mobile phone. The user can assess the chatbot using any supported mobile, desktop, or iPad device. The application tier, also known as the logic tier, is the heart of the application. The application is developed using programming languages such as Hyper Text Markup Language (HTML). Cascading Style Sheet (CSS). JavaScript as a front-end, and JavaScript as a back end. The Data tier store is where the information processed by the application is stored and managed. This chatbot uses Firebase as a Backend-as-a-Service (BaaS). BaaS is a cloud service model that allows developers to outsource all the behind-the-scenes aspects of the application, focusing on writing and maintaining the front end. Thus. Firebase is selected because it is a real-time database, and cloud hosting allows secure access directly to the database from client-side In the third phase, a few steps need to be considered to develop a chatbot, such as defining its purpose, understanding the audience, determining the chatbot personality, designing the user journey and conversation, developing the chatbot, integrating with NLP, and testing. The prototype of this chatbot uses the rule-based technique, as it provides a consistent response based on the predefined rules and ensures the user receives the same level of assessment. In the fourth phase, the chatbotAos usability was assessed using the SUS method. The SUS has been a reliable and validated tool for over 30 years, and it is widely used to evaluate various systems. In addition. SUS provides a quick, effective, and reliable method for assessing perceived ease of It can assist practitioners in identifying potential issues with a design solution and is a highly robust and versatile tool for evaluating usability. Develop Prototype Design Framework Theoretical Study Fig 1: Research Methodology Phases The first phase of the research process is theoretical study, which identifies the layout of the chatbot, how it will be implemented, the technology behind the chatbot, and a similar This research used a multi-method approach to collect primary and secondary data. A systematic literature review of the existing literature related to using chatbots in the mental health domain as the chatbot is a promising technology for facilitating mental health assessment. The sources of previous work related to the rule-based techniques are being analyzed to ensure the chosen method is applied to this study. The diversity of scientific databases such as Google Scholar. Science Direct. ACM Database. Ie Xplore, and Semantic Scholar are being referred to. A backward and forward reference list check was performed for the included studies and relevant reviews. Specific keywords guided study selection and data extraction. The extracted data were synthesized using a narrative approach. Chatbots were categorized based on their purpose, platform, response generation method, dialog management component, and their benefits in the mental health domain. Besides, semi-structured interviews were conducted with SMEs, psychiatrists, and registered counselors in public The respondents have more than five years of experience in mental health. The list of topics and structure of questions were designed to address how DGHI assists in the earlier detection of mental health issues, the appropriate use of instrument tools, and the promise of chatbots in the mental health domain. So, the SMEs were interviewed to collect information about mental health concerns, including the appropriate instrument to detect depression in the workplace. Incorporating relevant instruments for depression in technology could benefit users. The second phase, the chatbot's design, uses a conceptual diagram to identify the components included during its The conceptual diagram in Fig. 2 depicts the i. RESULTS AND DISCUSSION The Development of a Rule-based Chatbot for SelfDepression Screening Rule-based techniques can solve the issue of irrelevant results as the chatbot responds appropriately because it is based on the rule classifier and the selection of answers from usersAo choices. The input from users can be collected and become knowledge-based so the chatbot can give a response. The development of the rule-based chatbot for early depression indication involved several vital steps. First, a comprehensive set of rules was established based on established criteria for assessing depression, including symptoms, severity, and risk factors. These rules encompassed linguistic cues, such as specific keywords and phrases indicative of depressive thoughts and emotions, and behavioral patterns, such as social withdrawal, breathing difficulties, and fast heartbeat. Next, the chatbot's conversational flow was designed to elicit relevant information from users while providing empathetic responses and psychoeducation on depression. Finally, the chatbot was implemented and tested on diverse users to evaluate its accuracy and usability. The user interface (UI) is a medium for users to interact with the chatbot. The chatbot UI is developed using programming languages such as HTML. CSS, and JavaScript. The UI can be accessed via desktop and mobile using any The Home page describes the system's functions, how to use it, and the module it provides. To evaluate its effectiveness, a rule-based chatbot depression instrument tool. DepBot, was developed. DepBot is meant to assist depression risk users in indicating their depression status at an early stage by doing a self-depression indication assessment. The welcome page collects users' demographic data, as shown in Fig. Fig. 4 The User Message Analysis Component The user must complete all twenty-one questions, and the result will be calculated according to the specific calculation. The assessment was conducted using the existing instrument tool, namely DASS21 questionnaires for mental health. The main feature of the proposed chatbot is the assessment for depression indication. We used the Malay language mainly to raise a better understanding of the context, meaning, and content of our targeted Malaysian respondents, as shown in Fig. Fig. 5 DASS21 Instrument Tool for Depression in Malay Language The set of questionnaires consists of twenty-one . questions, divided equally into three categories: stress, anxiety, and depression. Each category holds seven questions, as shown in Table 1. Fig. 3 Main page of the depression instrument tool The UI controller directs the userAos request to the message analysis component, which determines the userAos intent and extracts entities based on pattern matching. As shown in Fig. 4, the Depression Instrument Tool page will be displayed after the user clicks Ujian Saringan Kesihatan Minda. TABLE I DASS21 ASSESSMENT CLASSIFICATION Category Stress Anxiety Depression Question Number TABLE II SEVERITY LEVEL OF DEPRESSION Four . options for the answer were given, and the options were categorized based on the symptom level. The first option is Tidak Langsung (Non. holds the value of zero . second option is Sedikit/Jarang-Jarang (Little/Rarel. holds the value of one . the third option is Banyak/Kerapkali (A Lot/Ofte. holds the value of two . last option is Sangat Banyak/Sangat Kerap (Very Much/Very Ofte. holds the value of three . The predefined rules, such as If Else, have been created to generate the result. The user needs to select one answer from 0 to 3, but if the user entered it differently, the chatbot will ask to re-enter from the answer selection. The user is required to select one option given for each of the questions. It consists of error handling. the user will be reminded to enter the proper selection of answers if the chatbot received the wrong value as an option from users. The total value from all the questions will be multiplied (*) by two . The total score will be mapped into scores from the severity level of depression, such as normal, mild, moderate, severe, and extremely severe. Fig. 6 indicates the rule classifier used to calculate the user's score. Level of Severity Normal Mild Moderate Severe Extremely Severe Depression Anxiety Stress These modules are used in the chatbot since it can control and update the conversational context. The dialog management component typically includes the following modules such as ambiguity handling, data handling and error However, this chatbot does not have ambiguity handling and data handling because it is specific to the close domain and depression assessment. Nevertheless, this chatbot is provided with error handling to cope with unexpected errors to ensure proper chatbot operation. For example, the user is required to select the given option for each of the questions. If the user enters other than the options, the chatbot will keep reminding the user to enter the correct answer as in . For . ar i=0. i