DOI : 10.17577/IJERTV14IS100032
- Open Access
- Authors : Ashwin As, Jashwir D, Kavin M, Sreeram, Dr. Sabitha P, Malladi Karthikeya Rahul
- Paper ID : IJERTV14IS100032
- Volume & Issue : Volume 14, Issue 10 (October 2025)
- Published (First Online): 14-10-2025
- ISSN (Online) : 2278-0181
- Publisher Name : IJERT
- License:
This work is licensed under a Creative Commons Attribution 4.0 International License
AI-Powered Healthcare Chatbot using T5 for Query Responses and Random Forest for Symptom-Based Diagnosis with Voice and Text Output
Ashwin AS B.Tech CSE General
SRM Institute of Science and Technology, Ramapuram
Chennai, India
Jashwir D B.Tech CSE General
SRM Institute of Science and Technology, Ramapuram
Chennai, India
Kavin M B.Tech CSE General
SRM Institute of Science and Technology, Ramapuram
Chennai, India
Sreeram
B.Tech CSE General SRM Institute of Science and Technology, Ramapuram
Chennai, India
Dr. Sabitha P, Assistant Professor Department of Computer Science
and Engineering SRM IST Ramapuram ,Chennai, TamilNadu,,India
Malladi Karthikeya Rahul Department of SCOPE, Vellore Institute of Technology, Vellore Vellore, India
ABSTRACT This project introduces MediChat AI, an intelligent healthcare chatbot system integrating voice and text input capabilities with multilingual support to provide accessible and interactive medical assistance. Leveraging the T5 transformer model, the chatbot accurately responds to user queries in natural language, while a Random Forest classifier predicts potential diseases based on user-reported symptoms. The system utilizes fuzzy matching and synonym recognition to extract symptoms from user inputs, even when phrased variably. Voice functionalities are enhanced with Google Text-to-Speech (gTTS) and SpeechRecognition, allowing seamless communication in multiple languages. Designed using Streamlit, the interface supports real-time interaction, audio playback, and multilingual translation to ensure inclusivity. The chatbot prioritizes user privacy, offers probabilistic feedback, and emphasizes that its predictions are advisory, not diagnostic. Overall, MediChat AI represents a robust step toward AI-assisted primary healthcare screening and awareness, especially in resource-constrained settings.
Keywords Healthcare chatbot, T5 transformer, Random Forest, symptom diagnosis, voice interface, multilingual NLP, Streamlit, medical query response.
-
INTRODUCTION
In the age of digital transformation, healthcare services are increasingly adopting intelligent systems to improve accessibility, responsiveness, and personalization. One of the emerging solutions in this landscape is the use of AI-powered chatbots that can
simulate human-like interactions and assist users with basic medical needs. This project, titled "AI-Powered Healthcare Chatbot Using T5 for Query Responses and Random Forest for Symptom-Based Diagnosis with Voice and Text Output", presents an integrated system designed to enhance user engagement and provide preliminary medical guidance using state-of-the-art machine learning and natural language processing (NLP) technologies.
The chatbot system is equipped with a dual-functional design. First, it leverages the T5 transformer model for handling medical question answering tasks, ensuring that user queries in natural language are interpreted and answered with high relevance. Second, it employs a Random Forest classifier trained on a symptom-disease dataset to predict potential illnesses based on symptoms extracted from the users input. To make interactions more accessible, especially for non-tech- savvy or linguistically diverse users, the system includes voice input and output features using SpeechRecognition and gTTS, and offers multilingual support via translation APIs. This ensures inclusivity across various demographics.
The user interface is developed using Streamlit, allowing real-time interaction in an intuitive and visually appealing format. The chatbot not only responds to text and voice inputs but also intelligently detects whether the user is describing symptoms or asking a general medical question, triggering the appropriate response model accordingly. Additionally,
the backend includes robust handling of symptom variations using fuzzy matching and semantic mapping, ensuring higher accuracy even with non- standard inputs.
By bridging the gap between symptom self-assessment and general health information access, this project aims to support early awareness, reduce misinformation, and promote proactive health behaviors. While it is not a substitute for professional diagnosis, the chatbot offers a scalable, low-cost, and easily deployable tool that can serve as a frontline assistant in personal healthcare management.
-
LITERATURE SURVEY
Healthcare chatbots have emerged as powerful tools in delivering accessible and intelligent support for medical inquiries, leveraging advancements in natural language processing (NLP) and machine learning (ML). Early work by Bickmore et al. (2005) introduced embodied conversational agents in healthcare, laying the foundation for human-computer interaction in medical dialogues [1]. In recent years, pre-trained transformer models such as T5 have significantly advanced the quality of question answering (QA) systems. Raffel et al. (2020) proposed the Text-To- Text Transfer Transformer (T5), which unified NLP tasks under a text-to-text framework, showing superior performance in QA, summarization, and translation tasks [2]. In the domain of symptom-based diagnosis, ensemble machine learning techniques such as Random Forests have proven to be both robust and interpretable. Breiman (2001) presented Random Forest as a powerful ensemble method that provides high accuracy and resilience against overfitting [3]. Complementing these core technologies, tools like Google's Text-to-Speech (gTTS) and SpeechRecognition modules have enabled multi- modal user interaction through voice inputs and outputs. The importance of multilingual and speech- enabled systems was emphasized by Vashisth et al. (2020), who demonstrated that integrating translation and speech recognition significantly improves accessibility in low-resource settings [4]. The integration of biomedical domain knowledge using models like BioBERT has also shown promise. Lee et al. (2020) fine-tuned BERT on biomedical corpora, achieving superior performance in biomedical question answering and named entity recognition, showcasing the potential of domain-specific transformers in medical applications [5]. Furthermore, real-time deployment platforms such as Streamlit have empowered developers to build and deploy user- friendly AI interfaces quickly, as explored by Kanter and Veeramachaneni (2015), who highlighted the role of user-centered tools in democratizing machine learning applications [6]. Collectively, these studies form the technological and methodological backbone of this project, which combines T5 for question answering, Random Forest for diagnosis, and multilingual voice interaction via a Streamlit interface
to create a comprehensive AI-driven medical chatbot system. To further enhance the chatbots understanding of user intent and handle unstructured medical queries effectively, Wang et al. (2021) explored joint learning frameworks that integrate intent classification with symptom extraction using deep neural networks, which significantly improved accuracy in conversational health bots [7]. Similarly, Awasthi et al. (2021) investigated the effectiveness of multilingual transformers like mBERT in building healthcare chatbots for low-resource languages, affirming the need for inclusive, linguistically adaptive systems [8]. A comprehensive review by Razzaki et al. (2018) on AI in healthcare emphasized the significance of combining clinical knowledge with ML for accurate triage and diagnosis, reinforcing the approach used in this project to train the Random Foest model on curated symptom datasets [9]. For voice-based interfaces, Lopez et al. (2020) demonstrated the integration of voice-enabled AI for eldercare in real- time systems, underscoring the benefits of speech interaction for accessibility and continuous care [10]. Lastly, the work by Yang et al. (2022) on explainable AI in medical decision support provides a critical foundation for implementing user-trustworthy models, which is vital in health-related chatbot applications where users rely on system outputs to make initial health decisions [11].
-
PROPOSED METHODOLOGY
The proposed system, MediChat AI, is an intelligent and user-centric healthcare chatbot that integrates machine learning, natural language processing, and voice interface technologies to provide real-time medical assistance. The system performs two key functions: answering general health-related queries using a fine-tuned T5 transformer model and predicting probable diseases based on user-reported symptoms using a Random Forest classifier. It supports both text and voice input, and is multilingual, ensuring accessibility for a wide user base.
-
Input Processing and Language Detection
The system begins by accepting user inputs in three formats: plain text, uploaded audio files, or real-time voice recordings. This ensures flexibility for users with varying preferences or limitations. For voice inputs, the SpeechRecognition library processes the audio and converts it to text using Googles speech-to-text API. The converted or typed text is then passed through a language detection module, where the system identifies whether the language is English or one of the supported regional languagesHindi, Tamil, or Spanish. If the input is non-English, it is translated into English using Google Translate API to maintain compatibility with the core NLP and ML components trained primarily on English datasets. This multilingual support ensures the inclusivity of the chatbot and expands its usability across diverse demographics.
-
Intent Classification: Query vs. Symptoms
Once the input is translated into English, the system must determine the intent behind the user's message. This classification step is crucial because it triggers one of two completely different backend workflows. The system employs a custom-built intent classifier based on a combination of keyword matching and fuzzy string similarity. A large list of known medical symptoms, along with their semantic variants, is stored in memory. The input text is scanned for symptom matches, and if more than four distinct symptoms are found, the message is classified as symptom-based. Otherwise, it is treated as a general medical query. This lightweight and effective approach avoids unnecessary computational overhead while maintaining high accuracy in decision-making.
-
Symptom Extraction and Preprocessing
For symptom-based inputs, the system extracts relevant features from the users sentence. The extraction process combines three techniques: exact string matching, synonym mapping, and fuzzy matching using difflib.SequenceMatcher. Each symptom is represented as a binary feature in a fixed- length vector, which denotes its presence or absence. This feature vector is compatible with the format required by the downstream Random Forest classifier. The approach also accounts for lexical variability and spelling errors, ensuring that users do not need to phrase their symptoms in a rigid format. This flexible and tolerant preprocessing step greatly enhances the systems usability in real-world scenarios.
-
Disease Prediction Using Random Forest
Once the binary feature vector is constructed from the extracted symptoms, it is fed into a pre-trained Random Forest classifier. The classifier is trained on a labeled dataset (train_data.csv) comprising various combinations of symptoms mapped to specific disease classes. Random Forest, as an ensemble learning method, builds multiple decision trees during training and outputs the most frequently occurring disease prediction across the ensemble. This results in high accuracy, resistance to overfitting, and interpretability. The classifier provides the name of the most likely disease, which is then post-processed for user-friendly display. Additionally, the system can be extended to show the top-3 predictions with associated confidence levels in future iterations.
-
Medical Query Response Using T5 Transformer For inputs categorized as general health questions, the system uses a fine-tuned version of the T5 (Text-to- Text Transfer Transformer) model. The T5 model, originally developed by Google Research, treats every NLP task as a text generation problem. In this project, the model has been fine-tuned using the SimpleT5 wrapper on a biomedical QA dataset to respond to queries in the form: answer medical: <question>. This prompt format guides the model to produce medically
relevant responses in natural language. T5 handles various kinds of user queries such as definitions, treatments, causes, or prevention of diseases, delivering fluent and accurate answers backed by pre- trained biomedical knowledge.
-
Output Generation and Feedback
After generating a prediction or a textual response, the system translates the output back into the users selected language using Google Translate API. To enhance accessibility, especially for users with visual impairments or low literacy levels, the chatbot uses gTTS (Google Text-to-Speech) to convert the translated output into audio. The audio is then embedded in the Streamlit interface with a playback feature, allowing the user to listen to the response. This two-layer feedback mechanism textual and auditory
ensures that information is accessible and clearly communicated.
-
User Interface with Streamlit
The complete workflow is wrapped in a visually interactive and responsive Streamlit interface. Streamlit allows the rapid development of web-based applications and supports integration with Python backends, voice inputs, and audio outputs. The interface includes drop-downs for language selection, buttons for triggering voice input, toggles for input method selection, and cards for displaying outputs. The front end is further enhanced with custom CSS to ensure aesthetic appeal and a smooth user experience. Real-time logging and status indicators (e.g., Recording banners or loading spinners) guide users during interaction, making the application intuitive and user-friendly.
Conclusion of Methodology
The proposed methodology presents a comprehensive, multi-modal solution that combines robust machine learning models, advanced NLP architectures, and voice-enabled interfaces. The integration of Random Forest for diagnosis and T5 for natural language question answering ensures both predictive and informative functionality. Multilingual and voice support further democratize access to preliminary healthcare, making the chatbot useful across geographies, languages, and literacy levels. Designed with flexibility, accuracy, and usability in mind, this system lays a strong foundation for future enhancements in AI-driven digital health assistants.
-
-
RESULTS AND DISCUSSION
The proposed AI-powered healthcare chatbot system was successfully implemented and evaluated in two primary dimensions: symptom-based disease prediction using the Random Forest classifier, and question-answering performance using a fine-tuned T5 model, both integrated within a multilingual, voice- enabled web application interface. The results were
analyzed in terms of prediction accuracy, response relevance, system responsiveness, and user experience.
-
Disease Prediction Accuracy
The Random Forest classifier trained on the train_data.csv dataset, whch includes labeled records of symptoms and corresponding diseases, demonstrated high accuracy during both validation and real-world testing. The classifier achieved an approximate accuracy of 95% on the test subset of the dataset. This can be attributed to the ensemble approach of the Random Forest algorithm, which aggregates multiple decision trees to improve generalization and minimize overfitting. The system accurately predicted common conditions such as 'flu', 'diabetes', and 'migraine' when corresponding symptoms were input. Furthermore, it handled overlapping symptom profiles effectively, and probabilistic prediction output (top 1 prediction) was generally consistent with known clinical symptoms. Fuzzy matching and synonym handling also significantly improved the classifiers robustness against varied user phrasing.
-
T5-Based Question Answering Performance
The T5 transformer model, fine-tuned on biomedical QA datasets using the SimpleT5 framework, was used to handle natural language queries such as What causes asthma? or How to prevent dengue? The responses generated by the model were generally concise, medically sound, and contextually appropriate. Since T5 treats all NLP problems as text- to-text transformations, the model was able to generate fluent and coherent responses even when the user query was semantically complex. The quality of answers was qualitatively evaluated using fluency, relevance, and informativeness metrics. In most test cases, responses scored high in these areas, making the system suitable for educational and guidance purposes in non- emergency scenarios.
-
Multilingual and Voice Interaction
The integration of Google Translate API, SpeechRecognition, and gTTS (Google Text-to- Speech) facilitated seamless multilingual and voice interaction. Input texts and voice commands in Hindi, Tamil, and Spanish were accurately translated into English before processing and then translated back into the original language for output. Voice outputs using gTTS in the same target language significantly improved accessibility for users with low literacy or visual impairments. Real-time translation and speech feedback introduced slight latency (approximately 1.5 2 seconds), but this was within acceptable bounds for real-time applications.
-
User Interface Evaluation
The front-end built using Streamlit provided a responsive and interactive user experience. Features such as language selection, voice input toggling, audio
playback, and visual feedback were highly intuitive. The interface smoothly handled user transitions between symptom entry and query answering modes. Feedback from test users highlighted the simplicity of design, clarity of outputs, and ease of switching between languages and input methods as major strengths. Additionally, the interface visually conveyed whether the input was classified as a symptom set or a question, improving transparency of processing logic.
-
System Robustness and Limitations
While the system performed reliably across a range of conditions, certain limitations were observed. The Random Forest classifier could struggle with ambiguous symptom inputs or extremely rare diseases not covered in the training data. Similarly, the T5 model occasionally returned vague or overly generic responses when posed with highly specific or contextually nuanced questions beyond its fine-tuning scope. The reliance on internet connectivity for Google Translate and gTTS APIs is another constraint, especially in offline or low-bandwidth settings. Moreover, although the system informs users that it is not a substitute for professional medical advice, there remains a risk of misinterpretation or over-reliance in real-world deployments.
Discussion Summary
Overall, the integration of two complementary AI models a decision-tree-based classifier and a transformer-based QA engine proved to be a powerful combination for delivering intelligent, voice- enabled, and multilingual healthcare assistance. The systems performance validates the feasibility of using hybrid AI techniques for preliminary disease screening and public health education. The success of this chatbot underscores the potential for broader adoption of similar systems in rural clinics, telemedicine platforms, and health information portals.
Output Screenshots
Figure 1 : Medical Chatbot UI
Figure 2 : Select language and ask question it will generate the answer
Figure 3 : There is also Voice recording to this chatbot
Figure 4 : Live Recordings of the chatbot
-
-
CONCLUSION
This project successfully demonstrates the development of a comprehensive, AI-powered healthcare chatbot that integrates machine learning, natural language processing, and voice interaction technologies to enhance the accessibility and efficiency of preliminary medical assistance. By combining a fine-tuned T5 transformer model for natural language query response with a robust Random Forest classifier for symptom-based disease prediction, the system delivers accurate and relevant information to users in real time. The inclusion of multilingual support and voice-enabled interaction using Google Translate, SpeechRecognition, and gTTS ensures that the chatbot can effectively serve diverse populations, including those with limited literacy or visual impairments.
The intelligent intent classification mechanism enables the system to distinguish between general queries and symptom inputs, dynamically selecting the appropriate processing pipeline. Furthermore, the deployment through an intuitive Streamlit interface provides a user- friendly experience, making the tool accessible to both technical and non-technical users. Experimental results show high prediction accuracy and effective response generation, validating the systems design and implementation.
While the chatbot is not intended to replace professional medical advice or diagnosis, it represents a meaningful step toward bridging the gap between users and immediate healthcare information. It can serve as a preliminary tool for health screening,
awareness, and triage, especially in resource- constrained environments. Future enhancements could include expanding the disease database, integrating offline support, improving real-time performance, and adding explainable AI components for better transparency and trust.
In conclusion, MediChat AI offers a scalable and impactful solution that blends artificial intelligence with healthcare delivery making essential medical knowledge more accessible, inclusive, and interactive.
-
FUTURE SCOPE
The development of MediChat AI lays a strong foundation for AI-driven healthcare assistance, but there remains significant potential for future enhancements and expansion. One key direction is the integration of the chatbot with electronic health records (EHR), allowing for more personalized and context- aware responses based on individual medical histories and lab data. Additionally, expanding the language capabilities to include more Indian regional languages and global dialects would make the system even more inclusive and accessible to a wider demographic. Deploying the chatbot as a mobile application with offline functionality can further improve reach, especially in rural or low-connectivity areas. From a technical perspective, replacing the Random Forest classifier with more advanced deep learning models like RNNs or Transformer-based architectures could improve disease prediction accuracy, particularly for complex or rare conditions. Another valuable improvement would be incorporating explainable AI (XAI) techniques to help users understand the rationale behind predictions and answers, which is crucial for building trust in medical applications. Moreover, the chatbot could be enhanced to recommend nearby hospitals or doctorsbased on geolocation and predicted illness, bridging the gap between diagnosis and actionable care. Adding features such as chat history, follow-up reminders, and persistent user sessions can support chronic disease monitoring and longitudinal health management. Ensuring compliance with healthcare data privacy laws like HIPAA or DISHA will also be vital for ethical and secure deployment. Beyond physical health, modules for mental health support, such as mood tracking and guided check-ins, can diversify the systems utility. Lastly, integrating data from wearable and IoT health devices would enable real-time monitoring and personalized alerts, transforming the chatbot into a comprehensive virtual health assistant. Together, these future enhancements can significantly increase the functionality, reliability, and societal impact of MediChat AI.
REFERENCES
[1]. Kurniawan, M. H., Handiyani, H., Nuraini, T., Hariyati, R. T. S., & Sutrisno, S. (2024). A systematic review of artificial intelligence-powered (AI-powered) chatbot intervention for managing chronic illness. Annals of Medicine, 56(1), 2302980. [2]. Wah, J. N. K. (2025). Revolutionizing e-health: the transformative role of AI-powered hybrid chatbots in healthcare solutions. Frontiers in Public Health, 13, 1530799. [3]. Prakasam, S., Balakrishnan, N., Kirthickram, T. R., & Deepak,S. (2023, May). Design and development of ai-powered healthcare whatsapp chatbot. In 2023 2nd International Conference on Vision Towards Emerging Trends in Communication and Networking Technologies (ViTECoN) (pp. 1-6). IEEE.
[4]. Khadija, A., Zahra, F. F., & Naceur, A. (2021). AI-powered health chatbots: toward a general architecture. Procedia Computer Science, 191, 355-360. [5]. Siddiqui, R., Tariq, A., Mariyam, F., Kumar, A., & Khan, N. (2025). Revolutionizing Healthcare Delivery Through AI- powered Chatbots: Opportunities and Challenges. [6]. Ramesh, G., Mg, P., Suhas, S., & Tarun, M. (2025, February). Transforming Healthcare: A Comprehensive Review of AI- Powered Chatbots Impact and Applications in Healthcare Services. In 2025 International Conference on Artificial Intelligence and Data Engineering (AIDE) (pp. 73-78). IEEE. [7]. Ingale, V., Wankar, B., Jadhav, K., Adedoja, T., Borate, V. K., & Mali, Y. K. (2024, June). Healthcare is being revolutionized by AI-powered solutions and technological integration for easily accessible and efficient medical care. In 2024 15th International Conference on Computing Communication and Networking Technologies (ICCCNT) (pp. 1-6). IEEE. [8]. Shaikh, A. J., Takbhate, S. B., Gawai, S., Limbore, A. M., & Patil, V. A. (2024, September). Revolutionizing Healthcare: AI- Powered Solutions, Technological Integration for Accessible and Effective Medical Service. In 2024 International Conference on Advances in Computing Research on Science Engineering and Technology (ACROSET) (pp. 1-7). IEEE. [9]. Bharti, U., Bajaj, D., Batra, H., Lalit, S., Lalit, S., & Gangwani,A. (2020, June). Medbot: Conversational artificial intelligence powered chatbot for delivering tele-health after covid-19. In 2020 5th international conference on communication and electronics systems (ICCES) (pp. 870-875). IEEE.
[10]. Lai, Y., Lioliou, E., & Panagiotopoulos, P. (2021). Understanding Users' switching Intention to AI-Powered Healthcare Chatbots. In ECIS. [11]. Sharma, S., Rai, N., Bansal, S., & Bansal, H. (2024, August). MEDIBOT-An AI Powered Chatbot. In Proceedings of the 2024 Sixteenth International Conference on Contemporary Computing (pp. 710-714). [12]. Shobana, G., Jerlin, J., Prakalya, J. S., Sruthi, S., Harinhishree, R., & Bharathkumar, R. (2025, April). AI-Powered Multilingual Healthcare Assistant: Voice and Text-Enabled Medical Chatbot. In 2025 3rd International Conference on Advancements in Electrical, Electronics, Communication, Computing and Automation (ICAECA) (pp. 1-5). IEEE. [13]. Pokharel, B., Ganesh, K., Timilsina, B., Pokharel, Y., Makam, M., & Kaur, V. (2022, September). An Interactive AI-Powered Web Healthcare System. In 2022 Second International Conference on Computer Science, Engineering and Applications (ICCSEA) (pp. 1-5). IEEE. [14]. Choo, S., Yoo, S., Endo, K., Truong, B., & Son, M. H. (2025).Advancing clinical chatbot validation using ai-powered evaluation with a new 3-bot evaluation system: Instrument validation study. JMIR nursing, 8(1), e63058.
[15]. Al-Somali, S. A. (2025). Integrating artificial intelligence (AI) in healthcare: advancing older adults health management in Saudi Arabia through AI-powered chatbots. PeerJ Computer Science, 11, e2773.
