Ijraset Journal For Research in Applied Science and Engineering Technology
Authors: Adit Pal Singh Sasan, Abhishek Kumar, Aditya Kunal Singh, Abhiraj Baruah
DOI Link: https://doi.org/10.22214/ijraset.2024.59868
Certificate: View Certificate
Embracing the knowledge era in healthcare, this research explores a novel medical chatbot empowered by the formidable Llama 2 language model. Transcending the limitations of conventional chatbots, it leverages a trifecta of technological prowess: Llama 2\'s vast knowledge base and nuanced understanding of medical language enable pinpoint- accurate responses, even to intricate inquiries. Chainlit\'s web framework sculpts an intuitive interface, empowering users to effortlessly navigate and visualize pertinent medical information. Faiss, the master of information retrieval, swiftly delivers curated medical resources tailored to the user\'s specific needs This research paves the way for a future where medical chatbots, wielding the power of knowledge, empower individuals to navigate the complexities of healthcare with confidence.
I. INTRODUCTION
Eyes are on the most important tools that is Llama2 Its encyclopaedic knowledge and medical language and the proficiency ensure pinpoint-accurate responses, even to complex inquiries, ChainLit is a web framework sculpts an intuitive interface, enabling users to seamlessly navigate and visualize the gleaned medical information from the ingested data and Faiss is retrieval maestro swiftly delivers curated insights tailored to the user's specific needs within the provided context.
Navigating the complexities of healthcare demands easy access to trustworthy medical information, a need often unmet by current chatbots.
These systems often stumble on intricate inquiries or lack crucial context, hindering their ability to offer accurate and helpful responses. This research pioneers a revolutionary medical chatbot that reshapes the landscape by wielding the power of knowledge and context-aware processing.
Unlike statically trained chatbots confined to pre-determined information, our proposed system thrives on a dynamic diet of medical knowledge. We harness the prowess of Llama 2, a language model notorious for its encyclopaedic memory and nuanced understanding of medical language. Imagine throwing it a medical scenario PDF - it doesn't just memorize. It meticulously dissects the information, weaving it into the very fabric of its knowledge tapestry. This empowers the chatbot to transcend the limitations of static datasets, tackling even the most intricate, context-specific questions with precision and depth. Our approach moves beyond the simplistic question-
II. LITERATURE SURVEY
J. Cahn et. al. in [1] This paper intends to unravel the attention and excitement surrounding Chatbots and their connection to conversational artificial intelligence. Both are gradually becoming more prevalent due to impressive advancements in machine learning, deep learning, and natural language comprehension.
Yet, the core mechanisms behind these technologies and their practical limitations remain our primary focus. While natural language is easily comprehensible for humans, its inherent ambiguity, complexity, and dynamism pose challenges for computers. We aim to critique the knowledge representation in statistical Chatbot solutions compared to linguistic alternatives, considering their ability to react intelligently.
E.Tebenkov and I.Prokhorov et. al. In [2] Machine learning serves as a data analysis technique enabling analytical systems to learn while addressing numerous similar problems. Its premise lies in enabling these systems to identify patterns and make decisions with minimal human intervention. In training chatbots for automated interactions, completed dialogues between users serve as historical data. This article delves into various prevalent machine learning algorithms, detailing their applications in educating chatbots for effective communication.
A. S. Lokman and M. A. Ameedeen et. el in [3] This paper aims to provide a technical assessment of five contemporary chatbot systems: DeepProbe (July 2017), Alime (August 2017), SuperAgent (August 2017), MILABOT (November 2017), and RubyStar (December 2017). The review encompasses architectural designs and case studies involving their implementation, along with performance evaluations. The architectural So this project comes with a great implementation of using feeded data for answering the any query triggered to this chatbot into the chatbots' knowledge domain, response generation, text processing, and machine learning models. In contrast, the implementation review will focus on dataset utilization, particularly for training machine learning models, and strategies for evaluating the quality of chatbot responses. A summary table consolidating the reviewed aspects will be presented, followed by discussions elucidating insights gleaned from these assessments. Finally, the paper will conclude by outlining future directions for modern chatbot design. frameworks will help in segregating the requested information on the user interface.
A. Kumar, P. K. Meena, D. Panda, and M. Sangeetha et.el In [4] A chatbot is a software program that engages in conversations through text or speech. It serves various functions, such as swiftly responding to inquiries, providing information, facilitating product purchases, and enhancing customer service. Operated on Artificial Intelligence (AI) and Machine Learning frameworks, chatbots have gained popularity among businesses due to their capability to reduce customer service expenses and handle multiple users simultaneously. However, to optimize their performance across various tasks, it's crucial to enhance their efficiency. In this project, we present a chatbot design leveraging Artificial Intelligence Markup Language (AIML) and Latent Semantic Analysis (LSA) within the Python platform. This design aims to deliver accurate and authentic responses to any query posed to the chatbot.
M. M. Hossain, S. Krishna Pillai, S. E. Dansy, and A. A. Bilong et. el In [5] A chatbot is a software program that engages in conversations through text or speech. It serves various functions, such as swiftly responding to inquiries, providing information, facilitating product purchases, and enhancing customer service. Operated on Artificial Intelligence (AI) and Machine Learning frameworks, chatbots have gained popularity among businesses due to their capability to reduce customer service expenses and handle multiple users simultaneously. However, to optimize their performance across various tasks, it's crucial to enhance their efficiency. In this project, we present a chatbot design leveraging Artificial Intelligence Markup Language (AIML) and Latent Semantic Analysis (LSA) within the Python platform. This design aims to deliver accurate and authentic responses to any query posed to the chatbot.
The chapter emphasizes AI-enabled methods such as AI-powered X-Ray and computed tomography image analysis, enabling contactless identification and diagnosis of COVID-19 patients. It aims to summarize the crucial roles of AI-driven techniques like Machine Learning and Deep Learning in analysing, predicting, and diagnosing COVID-19.
Additionally, it outlines several open challenges and future research areas concerning AI-driven approaches in combating the COVID-19 pandemic.
These challenges and potential research directions underscore the ongoing efforts and areas for further exploration in using AI for managing and understanding COVID-19.
G. Battineni, N. Chintalapudi, and F. Amenta et. el. In [14] The emergence of the Coronavirus (nCOV-as a global pandemic has strained hospitals and healthcare systems, especially in remote areas where access to medical specialists is limited. The deployment of a well-designed chatbot could significantly aid patients in these regions by offering guidance on preventive measures, providing updates on the virus, and alleviating psychological distress stemming from isolation and fear.
This study outlines the development of an advanced AI chatbot tailored for diagnostic evaluations and immediate recommendations for individuals exposed to nCOV-19. Furthermore, it introduces a virtual assistant capable of assessing infection severity and establishing connections with registered doctors when symptoms indicate a serious condition. This integrated system aims to provide crucial support to individuals in remote areas, enhancing their access to timely information and medical assistance during the pandemic.
D.Shin et. el. In [32] The impact of anthropomorphism on users' perceptions of whether they're interacting with a human or a chatbot is significant in chatbot environments. In our study, we construct a cognitive model incorporating anthropomorphism and explain ability to understand user experiences with conversational journalism (CJ) within chatbot-based news. We analyze how users perceive cues that make chatbots seem more human-like and understandable, and how these cues affect user attitudes towards CJ. When chatbots provide anthropomorphic explanations for their recommendations, users feel a sense of connection, leading to increased trust and emotional reassurance. This perception of human-like qualities influences users' judgments about CJ and their willingness to engage with chatbots. Our findings provide practical implications for chatbot design and highlight the importance of incorporating human-like characteristics in CJ. We introduce a theoretical framework to define human-like qualities as a crucial aspect of human-AI interaction, aiming for a scenario where humans perceive AI as akin to humans. These results deepen our understanding of human-chatbot interaction in CJ by shedding light on how users engage with chatbots and why they embrace CJ in this format.
Himanshu Gadge, Vaibhav Tode, Sudarshan Madane, Prof. Anuradha Deokar et. el. In [9]
The Chatbot is a software program that interacts with users through natural language processing, utilizing text or text-to-speech formats. In India, providing quality and affordable healthcare to the growing population is a significant challenge, compounded by issues of cost efficiency. The COVID- 19 pandemic exacerbated these challenges, revealing difficulties in transportation, doctor availability, and medical infrastructure, leading to treatment delays and increased mortality rates. Our project aims to address these issues by developing a Conversational AI-Powered Chatbot for Medical Diagnostics using Deep Learning, primarily targeting rural and underserved populations in India. Our system understands patient symptoms and engages with users via a web-based interface. By analysing patient-provided symptoms, it offers appropriate medications and precautions. We employ NLTK (Natural Language Toolkit) in Python, enabling symbolic and statistical Natural Language Processing to interpret speech inputs and generate human-like responses. This technology aims to bridge healthcare gaps and provide accessible medical guidance to those in need.
F. Mehfooz, S. Jha, S. Singh, S. Saini, and N. Sharma et. el. In [8] This paper delves into the evolution of conversational agents, known as chatbots, initially designed to respond to domain-specific queries. These chatbots act as software representatives facilitating computer-human interaction through natural language. The concept of chatbots emerged in the 1960s, aiming to mimic human responses to create a realistic conversational experience. Over time, chatbot technology has evolved from rule- based to AI-driven systems. These agents specialize in various domains, offering expertise in their respective fields. The primary focus here is on implementing a retrieval-based chatbot with voice support, exploring its role in assisting patients by providing comprehensive information about COVID- 19.
Athulya N, Jeeshna K, S J Aadithyan,U Sreelakshmi,Hairunizha Alias Nisha Rose et. el. In
In our project, we aim to develop a medical chatbot capable of diagnosing diseases and offering basic information before a doctor's consultation. This initiative intends to reduce healthcare expenses while enhancing access to medical knowledge. Chatbots, functioning as natural language-based computer programs, form the foundation of this endeavour.
Our focus lies in delivering users prompt and accurate disease predictions based on their symptoms. To achieve this, we've employed the Decision Tree algorithm. By enabling predictive diagnosis, chatbots have the potential to significantly impact the healthcare sector, contributing to its transformation.
Andrew Reyner Wibowo Tjiptomongsoguno et. el. In [12] The current imbalance betwavailable doctors and the increasing number of patients has raised concerns about healthcare accessibility. To address this issue, several studies propose using chatbots or health assistants as a viable solution. This paper aims to delve deeper into exploring chatbot technology's potential in providing individuals with equivalent and appropriate medical guidance akin to that of a doctor.
Mrs. Rashmi Dharwadkar1 , Dr.Mrs. Neeta A. Deshpande et. el In [13] This system addresses the issue of users lacking comprehensive knowledge about diseases, leading to unnecessary hospital visits for minor concerns and handling cumbersome phone complaints. It suggests using a medical ChatBot for guidance on healthy living. The ChatBot relies on Natural Language Processing to receive and respond to health-related queries, eliminating the need for physical hospital visits. Leveraging Google API for voice-text and text-voice conversion, users can interact with the ChatBot via an Android app. The primary goal of this web-based platform is to analyze customer sentiments.
K. H. Koundinya, A. K. Palakurthi, V. Putnala, and K. A. Kumar et. el In [17] Gone are the days of text-only interactions with services. Voice assistants and chatbots are rapidly changing the way users engage with systems. A chatbot, using AI within messaging platforms, can converse with humans in a natural way. As users interact, the chatbot learns and evolves, even with limited initial knowledge. The more interactions, the more precise its responses become. This project aims to bring this technology to Matrusri Engineering College by adding a chatbot feature and API. It will explore how AI and Machine Learning advancements are revolutionizing service delivery, focusing on chatbots as information distribution channels. The program utilizes WordNet to identify the closest matching statement and response to user input, drawing from a pre-built library of responses. Ultimately, this project seeks to implement an online chatbot system for the college website, leveraging AI tools like Natural Language Processing to enable natural language communication and empower the chatbot to learn and improve through Machine Learning techniques. While some applications strive for human-like appearance and simulated dialogue, most chatbots rely on human-built knowledge bases. This project takes a different approach, focusing on a dynamic, user-driven learning system.
H. Sharma and A. S. Jalal et. el In [28] Leveraging the hidden information within image text, this work proposes a novel VQA model that outperforms existing models by exploiting both visual features and textual cues. Utilizing PHOC and Fisher Vectors for robust textual representation, the model seamlessly integrates a transformer architecture with dynamic pointer networks for a multi-step answer decoding process, surpassing the limitations of prior classification-based approaches. Extensive evaluations on VQA 2.0, TextVQA, and ST-VQA
III. IMPLEMENTATION AND WORKING
We have created a medical chatbot using Llama 2 which was developed by mets AI. It is an open source large language model which is used to make chatbot. The decision to use "Llama 2" was influenced by its specific features such as user-friendly interface, adaptability to medical contexts, robustness in handling medical queries, which might have addressed limitations. It could also offer improved integration capabilities or enhanced natural language processing tailored for medical conversations.
The model of llama2 used is llama-2-tb-chat-ggmlv3_q8_0_bin. We have used the quantized model of this language model because we are running this on the CPU machine. This is the fastest language model which can be used to run a chatbot using CPU machine. The minimum required RAM in order to run this is 16 GB of RAM. This can also be run on a virtual GPU machine. The basic tools used for running this chatbot are Pypdf, Langchain, torch, accelerate, transformer, sentence_transformer, and faiss_cpu.
PyPDF is a Python library designed for PDF file handling. It might not directly shape the core functions of a chatbot. Yet, within a chatbot system, PyPDF could be applied to extract data from PDF documents. This capability allows the chatbot to access information contained in these files, like medical reports or guidelines.
By using PyPDF's features to extract text or relevant details from PDFs, the chatbot can then utilize this data to address user queries or offer pertinent information.Integrating PyPDF into the chatbot involves functionalities that enable reading PDF content, text extraction, conducting searches within documents, and potentially summarizing the information found.
Langchain is also an open source language model that is designed to empower the creation of applications which utilizes language model capabilities. There are different ways to do this process but some of the steps include: define the applicaton, develop functionality, customize capabilities, optimize language models and testing phase.
Talking about sentence transformers, It is a python framework which is used for sentence, text and image embeddings. It serves as a toolkit offering straightforward approaches for computing embeddings, which are dense vector representations, for sentences, paragraphs, and even images. It operates by embedding texts within a vector space, where similar text is positioned close together. This unique functionality facilitates various applications like semantic search, clustering, and retrieval based on the proximity of embeddings in the vector space.
Once the sentence transformer transforms the data which is fed, now we need to store it. We have used vectorDB to store the data. The vectorDB used is Faiss CPU. Since everything is run on a cpu machine and the minimum RAM required to run is 16GB. This library contains algorithm that search in sets of vector of any size that usually do not fit in the RAM. It also contains code for evaluation and parameter tuning.
This model also retains the memory of previously asked questions which is benefical as it saves a lot of time.
The data is fed into the ingest file, preprocessing is done by langchain loaders and splitters, now the embedding model which is sentence transformer for this case transforms the text in the pdf provided. Once transformed it needs to be stored. The user then enters the prompt and the Response is returned according to the pdf provided.
Powered by the robust combination of Llama2 and Chainlit, this innovative medical chatbot elevates patient engagement by leveraging advanced NLP for precise symptom input and accurate information delivery. Continuously evolving with an eye towards the future, the chatbot\'s capabilities will be further refined through the integration of machine learning for adaptive responses and an expanding knowledge base. Additionally, emerging technologies hold promising avenues for enhancing user interactions and tailoring healthcare recommendations. This forward-thinking initiative not only addresses immediate healthcare needs but also establishes a platform built for ongoing improvement, adapting to user requirements and staying abreast of technological advancements. Chainlit\'s secure infrastructure ensures data privacy compliance, underscoring the potential of AI-powered chatbots for secure and efficient healthcare information dissemination in a constantly evolving landscape.
[1] J. Cahn, ‘‘CHATBOT: Architecture, design, & development,’’ Dept. Com put. Inf. Sci., Univ. Pennsylvania School Eng. Appl. Sci., Philadelphia, PA, USA, Tech. Rep. EAS499, 2017. [2] E. Tebenkov and I. Prokhorov, ‘‘Machine learning algorithms for teaching AI chat bots,’’ Proc. Comput. Sci., vol. 190, pp. 735–744, Jan. 2021. [3] A. S. Lokman and M. A. Ameedeen, ‘‘Modern chatbot systems: A techni cal review,’’ in Proc. Future Technol. Conf. Cham, Switzerland: Springer, Nov. 2018, pp. 1012–1023. [4] A. Kumar, P. K. Meena, D. Panda, and M. Sangeetha, ‘‘Chatbot in Python,’’ Int. Res. J. Eng. Technol., vol. 6, no. 11, 2019. [5] M. M. Hossain, S. Krishna Pillai, S. E. Dansy, and A. A. Bilong, ‘‘Mr. Dr. Health-assistant chatbot,’’ Int. J. Artif. Intell., vol. 8, no. 2, pp. 58–73, Dec. 2021. [6] R. Dharwadkar and N. A. Deshpande, ‘‘A medical chatbot,’’ Int. J. Comput.Trends Technol., vol. 60, no. 1, pp. 41–45, 2018. [7] F. Mehfooz, S. Jha, S. Singh, S. Saini, and N. Sharma, ‘‘Medical chatbot for novel COVID-19,’’ in ICT Analysis and Applications. Singapore: Springer, 2021, pp. 423–430. [8] M. Herriman, E. Meer, R. Rosin, V. Lee, V. Washington, and K. G. Volpp, ‘‘Asked and answered: Building a chatbot to address COVID-19-related concerns,’’ NEJM Catalyst Innov. Care Del., vol. 1, pp. 1–13, Jun. 2020. [9] Athulya N, Jeeshna K, S J Aadithyan,U Sreelakshmi,Hairunizha Alias Nisha Rose et. el. In , ‘‘A chatbot for health care ,’’ J. Exp. Psychol., Appl., vol. 27, pp. 1–11, Oct. 2021. [10] P. Amiri and E. Karahanna, ‘‘Chatbot use cases in the COVID-19 pub lic health response,’’ J. Amer. Med. Inform. Assoc., vol. 29, no. 5, pp. 1000–1010, Apr. 2022. [11] M. Almalki and F. Azeez, ‘‘Health chatbots for fighting COVID-19: A scoping review,’’ Acta Inf. Medica, vol. 28, no. 4, p. 241, 2020. [12] P. Weber and T. Ludwig, ‘‘(Non-) interacting with conversational agents: Perceptions and motivations of using chatbots and voice assistants,’’ in Proc. Conf. Mensch Comput., vol. 1, Sep. 2020, pp. 321–331. [13] U. Bharti, D. Bajaj, H. Batra, S. Lalit, S. Lalit, and Gangwani, ‘‘Medbot: Conversational artificial intelligence powered chatbot for delivering tele health after COVID-19,’’ in Proc. 5th Int. Conf. Commun. Electron. Syst. (ICCES), Jun. 2020, pp. 870– 875. [14] G. Battineni, N. Chintalapudi, and F. Amenta, ‘‘AI chatbot design during an epidemic like the novel coronavirus,’’ Healthcare, vol. 8, no. 2, pp. 1–8, Jun. 2020. [15] B. A. Shawar and E. Atwell, ‘‘Using dialogue corpora to train a chatbot,’’ in Proc. Corpus Linguistics Conf., Mar. 2003, pp. 681–690. [16] S. Raj and K. Raj, Building Chatbots With Python. New York, NY, USA: Apress, 2019. [17] K. H. Koundinya, A. K. Palakurthi, V. Putnala, and K. A. Kumar, ‘‘Smart college chatbot using ML and Python,’’ in Proc. Int. Conf. Syst., Comput., Automat. Netw. (ICSCAN), Jul. 2020, pp. 1–5. [18] S. A. Sheikh, ‘‘Artificial intelligence based chatbot for human resource using deep learning,’’ Ph.D. dissertation, Dept. Comput. Sci. Eng., Manipal Univ., Manipal, India, 2019. [19] S. J. Daniel, ‘‘Education and the COVID-19 pandemic,’’ Prospects, vol. 49, no. 1, pp. 91–96, 2020. [20] N. Rosruen and T. Samanchuen, ‘‘Chatbot utilization for medical consul tant system,’’ in Proc.3rd Technol. Innov. Manag. Eng. Sci. Int. Conf. (TIMES-iCON), Dec. 2018, pp. 1–5. [21] K. Rarhi, A. Bhattacharya, A. Mishra, and K. Mandal, ‘‘Automated medi cal chatbot,’’ Tech. Rep., 2017. [22] S. Majumder and A. Mondal, ‘‘Are chatbots really usefulforhuman resource management?’’ Int. J. Speech Technol., vol. 24, no. 4, pp. 969– 977, Dec. 2021. [23] A. S. Ashour, A. El-Attar, N. Dey, H. A. El-Kader, and M. M. A. El-Naby, ‘‘Long short term memory based patient-dependent model for FOG detec tion in Parkinson’s disease,’’ Pattern Recognit. Lett.,vol. 131, pp. 23–29, Mar.2020,10.1016/j.patrec.2019.11.036. [24] S. J. Fong, N. Dey, and J. Chaki, ‘‘AI-enabled technologies that fight the coronavirus outbreak,’’ in Artificial Intelligence for Coronavirus Outbreak. Singapore: Springer, 2021, pp. 23–45. [25] S. Chakraborty and L. Dey, ‘‘The implementation of AI and AI-empowered imaging system to fight against COVID-19—A review,’’ in Smart Health care System Design: Security and Privacy Aspects. 2022, pp. 301– 311. [26] L. Dey, S. Chakraborty, and A. Mukhopadhyay, ‘‘Machine learn ing techniques for sequence-based prediction of viral–host interactions between SARS-CoV-2 and human proteins,’’ Biomed. J., vol. 43, no. 5, pp. 438–450, 2020. [27] R. K. Tripathi and A. S. Jalal, ‘‘A robust approach based on local feature extraction for age invariant face recognition,’’ Multimedia Tools Appl., vol. 81, pp. 21223–21240, Mar. 2022. [28] H. Sharma and A. S. Jalal, ‘‘A framework for visual question answering with the integration of scene-text using PHOCs and Fisher vectors,’’ Expert Syst. Appl., vol. 190, Mar. 2022, Art. no. 116159. [29] U. Singh and M. K. Choubey, ‘‘A review: Image enhancement On MRI images,’’ in Proc. 5th Int. Conf. Inf. Syst. Comput. Netw. (ISCON), 2021, pp. 1–6. [30] S. Al-Imamy and Y. Hwang, ‘‘Cross-cultural differences in information processing of chatbot journalism: Chatbot news service as a cultural arti fact,’’ Cross Cultural Strategic Manag., vol. 29, no. 3, pp. 618–638, 2022, doi: 10.1108/CCSM-06-2020- 0125. [31] D. Shin, ‘‘The perception of humanness in conversational journalism: An algorithmic information-processing perspective,’’ New Media Soc., vol. 24, no. 12, pp. 2680–2704, Dec. 2022, doi: 10.1177/1461444821993801. [32] T. N. K. Hung, N. Q. K. Le, N. H. Le, L. Van Tuan, T. P. Nguyen, C. Thi, and J.-H. Kang, ‘‘An AI-based prediction model for drug-drug interactions in osteoporosis and Paget’s diseases from SMILES,’’ Mol. Informat., vol. 41, no. 6, Jun. 2022, Art. no. 2100264.
Copyright © 2024 Adit Pal Singh Sasan, Abhishek Kumar, Aditya Kunal Singh, Abhiraj Baruah. This is an open access article distributed under the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.
Paper Id : IJRASET59868
Publish Date : 2024-04-05
ISSN : 2321-9653
Publisher Name : IJRASET
DOI Link : Click Here