<?xml version="1.0" encoding="UTF-8"?>
<article xmlns:xlink="http://www.w3.org/1999/xlink">
<front><article-meta>
<title-group><article-title>Healthchare Chatbot Using SVM &amp; Decision Tree</article-title></title-group>
<contrib-group>
<contrib contrib-type="author"><name><surname>Chandel</surname><given-names>Atika</given-names></name><xref ref-type="aff" rid="aff1"/></contrib>
<aff id="aff1">Kalinga Institute of Industrial Technology, India.</aff>
</contrib-group>
<abstract><p>The increasing demand for efficient healthcare services and the limitations posed by a shortage of medical professionals have accelerated the development of intelligent healthcare solutions. This research presents a healthcare chatbot designed using Support Vector Machines (SVM) and decision tree algorithms to deliver accurate and timely disease predictions based on user-provided symptoms. The chatbot is aimed at bridging the gap between healthcare providers and patients, offering an accessible platform that mimics the interactions of a human medical professional. By leveraging machine learning techniques, the chatbot can classify symptoms, provide medical guidance, and recommend further medical consultation when necessary. The SVM model categorizes symptoms to identify potential health issues, while the decision tree algorithm predicts diseases and suggests treatment paths based on input data. The system was tested using real-world healthcare datasets to ensure accurate disease prediction and effective user interaction. Experimental results demonstrate that the chatbot achieves high accuracy in predicting diseases, significantly outperforming traditional rule-based systems. The system offers improved response times and enhanced user engagement by providing personalized, context-aware recommendations. Despite its advantages, limitations such as model retraining requirements and data biases were observed, paving the way for future enhancements.In conclusion, this chatbot represents a scalable and user-friendly solution to healthcare challenges, especially in regions with limited medical resources. By providing timely assistance, it has the potential to alleviate pressure on healthcare systems, improve patient outcomes, and foster better access to medical guidance. Future work will further integrate advanced NLP capabilities, expand its disease database, and refine user interaction mechanisms to enhance its utility and accuracy.</p></abstract>
<kwd-group kwd-group-type="author"><kwd>Healthcare chatbot</kwd><kwd>Support vector machine</kwd><kwd>Decision tree</kwd><kwd>Disease prediction</kwd><kwd>Natural language</kwd></kwd-group>
</article-meta></front>
<body>
<sec id="sec-1">
<p>processing, Medical assistance, Machine learning, Symptom classification, User interaction.</p>
</sec>
<sec id="sec-2"><label>1</label><title>Introduction</title>
<p>In recent years, chatbots have emerged as influential digital tools capable of interacting with users through natural language interfaces. These systems, powered by Artificial Intelligence (AI), can respond to users&apos; queries and provide relevant real-time information <xref ref-type="bibr" rid="ref-1">[1]</xref>. Chatbots are proving their versatility across multiple domains with applications spanning customer support, virtual assistance, online reservations, and general conversation. The healthcare sector, in particular, benefits immensely from chatbot technology due to its potential to alleviate systemic issues such as resource shortages, limited accessibility, and the growing demand for healthcare services <xref ref-type="bibr" rid="ref-2">[2]</xref>. Healthcare chatbots, designed to assist patients by delivering instant access to health information, symptom analysis, and potential disease predictions, represent a promising frontier in digital healthcare innovation.</p>
<p>Despite their potential, many healthcare chatbots face limitations that restrict their effectiveness. Most existing systems provide pre-scripted, monotonous responses that are often incapable of engaging users in nuanced, empathetic interactions. Consequently, these chatbots struggle to simulate the experience of conversing with a medical professional, reducing the likelihood that users will feel comfortable sharing detailed or sensitive health information. Without the capability for adaptive, intelligent communication, such systems may fail to capture critical information from users, which could lead to accurate health assessments or timely interventions. Recognizing these limitations, this research aims to design and develop a healthcare chatbot that transcends these traditional constraints by leveraging machine learning algorithms specifically, Support Vector Machines (SVM) and decision tree models to enable a more interactive, responsive, and human-like experience.</p>
<p>The proposed healthcare chatbot utilizes Natural Language Processing (NLP) to interpret and analyze user inputs in a way that mimics the conversational skills of a human healthcare provider. By integrating machine learning models, the chatbot can dynamically classify symptoms, predict potential health issues, and provide actionable recommendations tailored to each user’s unique situation. The SVM algorithm is particularly suited for high-dimensional data classification and can effectively differentiate between various medical symptoms to support diagnostic predictions. Meanwhile, decision tree models introduce a layer of interpretability, allowing the system to factor in multiple variables from past interactions, symptoms, and user history, thus enabling more personalized and contextually relevant responses.</p>
<p>This study is motivated by the ongoing challenges in global healthcare access, particularly in regions with significant resource limitations, such as rural or underserved areas. In developing countries like India, where healthcare infrastructure is often stretched thin due to high population density and limited professional availability, healthcare chatbots have the potential to fill essential gaps by offering basic medical support and guidance. By acting as a virtual assistant, the proposed chatbot can extend healthcare access to individuals who may otherwise face long waiting times or geographic barriers to traditional healthcare services. As such, this research aims to create a scalable solution that enhances user engagement and satisfaction and provides timely medical assistance, thereby alleviating some of the strain on healthcare systems in resource-constrained settings.</p>
</sec>
<sec id="sec-3"><label>2</label><title>Literature Review</title>
<p>The integration of AI and NLP has revolutionized healthcare, particularly through the development of chatbots. These digital assistants are increasingly deployed to provide medical information, triage patients, and offer personalized health advice.</p>
<p>Early chatbot systems, such as ELIZA and A.L.I.C.E., relied on simple pattern recognition and scripted responses, demonstrating the potential for human-computer interaction in healthcare. However, their limitations in understanding complex queries and providing contextually relevant information hindered their widespread adoption.</p>
<p>Recent advancements in AI and NLP have enabled more sophisticated chatbot systems to be developed. Flora Amato et al. explored using AI-driven chatbots to engage patients in personalized health conversations, utilizing platforms like IBM Watson. This research highlighted the potential of chatbots to simulate human-like interactions and deliver tailored health advice.</p>
<p>Divya et al. <xref ref-type="bibr" rid="ref-3">[3]</xref> proposed a linear approach to symptom extraction and disease diagnosis, emphasizing the importance of accurate symptom mapping for effective chatbot-based healthcare. This approach can help identify potential health conditions and guide users to appropriate medical attention.</p>
<p>Kowatsch et al. <xref ref-type="bibr" rid="ref-4">[4]</xref> focused on developing text-based healthcare chatbots for mobile applications, emphasizing patient interaction and daily health monitoring. These systems can enhance patient adherence to treatment plans by providing consistent communication and reminders. However, their reliance on predefined scripts and pattern-matching techniques limits their scalability and adaptability.</p>
<p>Our research proposes a chatbot that integrates SVM and decision tree algorithms for disease prediction to address these limitations. This approach aims to improve the accuracy and adaptability of chatbot interactions by leveraging predictive modeling and real-time data analysis. The chatbot can predict potential diseases by analyzing user-provided symptoms and providing relevant medical advice.</p>
<p>In conclusion, integrating AI and NLP techniques has significantly advanced the capabilities of healthcare chatbots. However, more sophisticated systems that can adapt to diverse user inputs, provide accurate diagnoses, and offer personalized health recommendations are still needed. Our proposed chatbot addresses these challenges by combining advanced machine learning algorithms with NLP techniques.</p>
<table-wrap id="tab1"><label>Table 1</label><caption><p>Comparative analysis.</p></caption><graphic content-type="pdf-region" xlink:href="pdf-region:2:51.7,199.1,542.4,518.7"/><p content-type="note">This table is shown in the PDF version of the article.</p></table-wrap>
</sec>
<sec id="sec-4"><label>3</label><title>Variables and Equations</title>
<p>Various variables and mathematical equations are essential for effective data processing, decision-making, and user interaction in developing an AI-based health chatbot. Here is an overview of key components that define the underlying operations and behavior of such a system:</p>
<sec id="sec-5"><label>3.1</label><title>Key Variables</title>
<sec id="sec-6"><title>User input variables (U)</title>
<p>Represent user-provided data such as symptoms, queries, or contextual information. Example: U = {s1, s2, ..., sn} }, where si denotes each symptom or input item.</p>
</sec>
<sec id="sec-7"><title>Training data variables (D)</title>
<p>Represents datasets used to train the chatbot’s machine learning models, including symptom descriptions, severity levels, and treatment recommendations, D = {(x1, y1), (x2, y2), ..., (xm, ym).</p>
<p>Here, xi is an input instance (e.g., symptoms), and yi is the expected output (e.g., diagnosis or recommendation).</p>
</sec>
<sec id="sec-8"><title>Response variables (R)</title>
<p>Represent the chatbot&apos;s outputs, such as disease predictions or user advice. Example: R = f(U), where f is a function that processes user input and generates a response.</p>
</sec>
<sec id="sec-9"><title>Machine learning model parameters (θ)</title>
<p>Include weights, biases, and other parameters adjusted during the training phase to optimize predictions. These parameters are adjusted using algorithms such as gradient descent to minimize error between predicted and actual outputs. Equations used in AI health chatbot.</p>
</sec>
<sec id="sec-10"><title>Symptom classification (decision function)</title>
<p>F(x) =argmaxy , P(y | x,θ).</p>
<p>I. F(x) predicts the most probable disease y given input features x (user symptoms) and parameters θ.</p>
<p>II. The decision function is typically used with classifiers like SVM or decision trees.</p>
</sec>
<sec id="sec-11"><title>Similarity matching (NLP for user queries)</title>
<p>Count (Qi ∩ Qj) Similarity (Qi, Qj) = .</p>
<p>√Count (Qi × √Count (Qj )</p>
<p>Measures similarity between user queries Qi and known responses using cosine similarity.</p>
</sec>
<sec id="sec-12"><title>Confidence score calculation</title>
<p>∑n i=1 wi. si C = n .</p>
<p>∑i=1 wi</p>
<p>C denotes the confidence score for a given response based on weights assigned to symptoms or user inputs.</p>
</sec>
<sec id="sec-13"><title>Decision tree for diagnosis</title>
<p>A decision tree uses recursive splitting based on conditions to reach a diagnosis: f si &lt; t, then branch A else branch B. Here, si is the symptom score, and t is a threshold value determined by training data.</p>
<p>This mathematical framework helps the AI-based health chatbot offer accurate responses, make informed decisions, and enhance user interactions through continuous learning and adaptation.</p>
</sec>
</sec>
</sec>
<sec id="sec-14"><label>4</label><title>Proposed Framework</title>
<p>The proposed framework for the healthcare chatbot leverages a combination of NLP and machine learning algorithms to deliver accurate disease prediction and user-specific medical advice. The system is designed to provide a user-friendly, interactive experience, allowing patients to input symptoms via a text-based interface. The chatbot then processes this input to diagnose potential health issues and offer tailored responses, including treatment recommendations or guidance to seek further medical consultation.</p>
<p>The framework comprises four main components: a user input module, an NLP module, a machine learning module, and a response generation module. The user input module captures and preprocesses user queries, removing noise and extracting relevant keywords. The NLP module analyzes these keywords, applies tokenization, and identifies critical phrases to understand the user&apos;s intent and symptoms better. This processed data is then passed to the machine learning module, which employs SVM to classify symptoms and decision tree algorithms to predict diseases.</p>
<p>The decision tree component of the system determines possible diagnoses by evaluating the hierarchy of symptoms, taking into account their severity and any related contextual factors. This hierarchical decision-making process helps narrow potential diseases, ensuring the system offers relevant and accurate responses. The SVM model complements this by categorizing symptoms into distinct classes, enabling more precise diagnosis and reducing prediction ambiguity.</p>
<p>Once the diagnosis is made, the response generation module crafts a customized response, including symptom-specific advice, recommended precautions, or information about nearby healthcare professionals if further treatment is necessary. This modular design ensures the chatbot can engage in dynamic, context-aware conversations and adapt to varied user inputs.</p>
<p>The proposed framework facilitates intelligent disease prediction and emphasizes accessibility, scalability, and user engagement, offering a powerful tool to enhance healthcare delivery and accessibility.</p>
<fig id="fig1"><label>Figure 1</label><caption><p>Data-flow diagram.</p></caption><graphic content-type="pdf-region" xlink:href="pdf-region:4:66,222,537,508.2"/><p content-type="note">This figure is shown in the PDF version of the article.</p></fig>
</sec>
<sec id="sec-15"><label>5</label><title>System Architecture</title>
<p>The above figure proceeds with the user can start their conversation with the chatbot that is user-friendly, and it will be stored in the database for future reference. The chatbot will clarify the user&apos;s symptoms with a series of questions, and the symptom confirmation will be done. The disease will be categorized as minor and major disease. The chatbot will reply whether it&apos;s a major or minor disease. If it&apos;s significant, the user will be suggested with the doctor&apos;s details for further treatment and display the analgesics. It also provides food suggestions, which means which food you have to take more to recover from the disease. The chatbot user interface can be user-friendly by using chatbot not to go to hospitals for even small problems.</p>
<fig id="fig2"><label>Figure 2</label><caption><p>Operational overview.</p></caption><graphic content-type="pdf-region" xlink:href="pdf-region:5:66,509.6,537,739.7"/><p content-type="note">This figure is shown in the PDF version of the article.</p></fig>
</sec>
<sec id="sec-16"><label>6</label><title>Experimental Setup</title>
<p>Before we began our set-up, we needed the relevant datasets, which we browsed and referenced from Kaggle <xref ref-type="bibr" rid="ref-5">[5]</xref>. The datasets are training, testing, symptom description, symptom severity, and sympotom precaution. To start the set-up, we imported the necessary libraries, namely pandas, sklearn, numpy, csv, and warnings. Preprocessing, decision tree classifier, tree, train test split, and cross val score were imported from sklearn&apos;s different sub-libraries.</p>
<p>Afterward, we read the training and testing datasets (X held the symptoms, and Y held the prognosis) with pandas and visualized them with functions such as head and info. When data reduction was made using a group, we found 41 unique diseases and 133 symptoms. From preprocessing, we used &apos;LabelEncoder&apos; to transform our prognosis from Y so that every prognosis had a unique numeric value we could use. We then split the training dataset into a 1:2 ratio of test and train.</p>
<p>Using the Decision Tree Classifier, we ran the train test split from the experimental set-up to get a cross-validation score of 0.979. Using an SVC model, we got a model score of 1.</p>
<p>Using feature importances from decision tree classifier, we assigned different importance to the symptoms and visualized them using print.</p>
<p>We then set up four distinct dictionaries, severity dictionary, description_list, precaution dictionary, and symptoms-dict, to map severity, descriptions, precautions, and symptoms from the datasets. We then calculated the severity of the condition by using the sum of days, severity, and length of symptoms.</p>
<p>Finally, we take user input on the symptoms they&apos;re facing, encode it, and pass it through a function that provides an interactive diagnostic experience. It collects user input on symptoms and symptom duration, traverses the tree to predict disease, cross-checks the prediction with additional symptoms, and provides explanations and precautions.</p>
</sec>
<sec id="sec-17"><label>7</label><title>Experimental Results and Discussion</title>
<p>The final result of the project looks something akin to.</p>
<fig id="fig3"><label>Figure 3</label><caption><p>Example output.</p></caption><graphic content-type="pdf-region" xlink:href="pdf-region:6:66,397.7,537,725.2"/><p content-type="note">This figure is shown in the PDF version of the article.</p></fig>
<p>To evaluate the proposed healthcare chatbot&apos;s performance, we utilized a publicly available medical dataset containing a diverse range of symptoms, diagnoses, and treatment recommendations. The dataset was preprocessed to ensure data quality and consistency.</p>
<sec id="sec-18"><label>7.1</label><title>Model Implementation</title>
<p>The chatbot was implemented using Python, leveraging popular libraries such as NLTK, Scikit-learn, and Tensor Flow. The SVM and Decision tree models were trained on the preprocessed dataset, with hyperparameters tuned using grid search and cross-validation techniques.</p>
<p>Using the decision tree classifier, we ran the train test split from the experimental set-up to get a cross-validation score of 0.979, and upon using an SVC model, we got a model score of 1. By further manual testing, the chatbot ensured that the predictions were in line with the dataset</p>
</sec>
</sec>
<sec id="sec-19"><label>8</label><title>Conclusion</title>
<p>Our medical chatbot is designed to provide essential medical assistance to patients suffering from common ailments such as fever, cold, typhoid, malaria, and jaundice. Given our country&apos;s increasing population and limited number of healthcare professionals, this chatbot aims to address the growing healthcare needs. While similar systems exist in foreign countries, they are not readily accessible in our nation. By deploying this chatbot, we aim to bridge this gap and improve the efficiency and performance of the medical industry, ultimately reducing mortality rates <xref ref-type="bibr" rid="ref-6">[6]</xref>.</p>
<p>Our chatbot incorporates a wide range of crucial features for providing effective medical assistance. Unlike previous models, which were often expensive and inaccessible to the general public, our system is designed to be affordable and user-friendly. The integration of AI-powered chatbots into healthcare has the potential to revolutionize patient care. These chatbots can significantly reduce healthcare costs and enhance overall efficiency by automating routine tasks, improving communication, and facilitating faster decision-making. The user-friendly interface of our chatbot allows individuals to easily interact with the system and receive timely medical advice, regardless of their technical expertise <xref ref-type="bibr" rid="ref-7">[7]</xref>.</p>
<p>For future scope, there can be wider data sets used; introducing neural networks along with decision trees can help tackle more complicated cases; as decision trees are limited to the data provided, deep neural networks will help with extrapolating and judging the service even if it the prognosis isn&apos;t present in our current dataset. In addition, LLMs could be introduced for a more de-centralized execution if the model is hosted, and it&apos;ll be self-improving as more and more users log on to the platform.</p>
</sec>
<sec id="sec-20"><title>Acknowledgments</title>
<p>We sincerely thank Dr. Shubadip Pramanik for his steadfast support and invaluable guidance throughout this project. His expertise and dedication were pivotal in shaping every aspect, from the initial undertaking to curating the report and research paper. This endeavor would not have been possible without his critical insights and unwavering encouragement.</p>
</sec>
<sec id="sec-21"><title>Author Contribution33</title>
<p>Data collection, cleaning, and analysis, Dewansh Saboo, Saswati Padhy. Proposed Framework, Atika Chandel. Experimental Set-up, Nekhil K. Agarwal.</p>
</sec>
</body>
<back><ref-list><title>References</title>
<ref id="ref-1"><label>1</label><mixed-citation>Wu, L. (2024). Research on the application of mechanical automation feedback control in vehicle stability control under fatigue driving state. 2024 3rd international conference on artificial intelligence and autonomous robot systems (AIARS) (pp. 356–361). IEEE. <ext-link ext-link-type="uri" xlink:href="https://doi.org/10.1109/AIARS63200.2024.00073">https://doi.org/10.1109/AIARS63200.2024.00073</ext-link></mixed-citation></ref>
<ref id="ref-2"><label>2</label><mixed-citation>Kumar, A., Bag, A., Anand, A., Saha, S., Mohapatra, H., &amp; Kolhar, M. (2025). Examining healthcare services utilizing cloud technology in intelligent urban environments. In Revolutionizing healthcare systems through cloud computing and IoT (pp. 77–98). IGI Global. <ext-link ext-link-type="uri" xlink:href="https://doi.org/10.4018/979-8-3693-7225-8.ch004">https://doi.org/10.4018/979-8-3693-7225-8.ch004</ext-link></mixed-citation></ref>
<ref id="ref-3"><label>3</label><mixed-citation>Divya, S., Indumathi, V., Ishwarya, S., Priyasankari, M., &amp; Devi, S. K. (2018). A self-diagnosis medical chatbot using artificial intelligence. Journal of web development and web designing, 3(1), 1–7. <ext-link ext-link-type="uri" xlink:href="https://core.ac.uk/download/pdf/230494941.pdf">https://core.ac.uk/download/pdf/230494941.pdf</ext-link></mixed-citation></ref>
<ref id="ref-4"><label>4</label><mixed-citation>Kowatsch, T., Nißen, M., Shih, C. H. I., Rüegger, D., Volland, D., Filler, A., ... &amp; Farpour-Lambert, N. (2017). Text-based healthcare chatbots supporting patient and health professional teams: Preliminary results of a randomized controlled trial on childhood obesity. Persuasive embodied agents for behavior change (PEACH2017). ETH Zurich, Department of Management, Technology and Economics. <ext-link ext-link-type="uri" xlink:href="https://www.researchgate.net/publication/320161507_Text-based_Healthcare_Chatbots_Supporting_Patient_and_Health_Professional_Teams_Preliminary_Results">https://www.researchgate.net/publication/320161507_Text-based_Healthcare_Chatbots_Supporting_Patient_and_Health_Professional_Teams_Preliminary_Results</ext-link> _of_a_Randomized_Controlled_Trial_on_Childhood_Obesity</mixed-citation></ref>
<ref id="ref-5"><label>5</label><mixed-citation>Kaggle. (2020). What are some of the best ways to find datasets? <ext-link ext-link-type="uri" xlink:href="https://www.kaggle.com/questions-and-answers/280618">https://www.kaggle.com/questions-and-answers/280618</ext-link></mixed-citation></ref>
<ref id="ref-6"><label>6</label><mixed-citation>Mohapatra, H., Mishra, S. R., Rath, A. K., &amp; Kolhar, M. (2025). Sustainable cities and communities: Role of network sensing system in action. Networked sensing systems, 173–198. <ext-link ext-link-type="uri" xlink:href="https://doi.org/10.1002/9781394310890.ch7">https://doi.org/10.1002/9781394310890.ch7</ext-link></mixed-citation></ref>
<ref id="ref-7"><label>7</label><mixed-citation>Priyadarshi, S., Subudhi, S., Kumar, S., Bhardwaj, D., &amp; Mohapatra, H. (2025). Analysis on enhancing urban mobility with IoT-integrated parking solutions. In Interdisciplinary approaches to transportation and urban planning (pp. 143–172). IGI Global. <ext-link ext-link-type="uri" xlink:href="https://doi.org/10.4018/979-8-3693-6695-0.ch006">https://doi.org/10.4018/979-8-3693-6695-0.ch006</ext-link></mixed-citation></ref>
</ref-list></back>
</article>