2022 IEEE World Conference on Applied Intelligence and Computing
Health Care Chatbot using Natural Language Processing
with SGD and ADAM Optimizer Parameter Optimization
(Paper ID-587)
Authors Name
Kailash Chandra Bandhu, Binod Kumar Mishra, Narottam Choyal, Prakhar Varathe,
Mohit Patel & Priya Koushal
Department of Computer Science and Engineering
Medi-Caps University
Indore, India
Presented by
Binod Kumar Mishra & Kailash Chandra Bandhu
1
Contents
• Abstract
• Introduction
• Literature Survey
• Methodology
• Implementation Output
• Result
• Conclusion
• References
2
Abstract
In today’s world, everyone is not quite sure about the medicine that the users used in a
similar situation or critical situation where any medical emergency has come and as all
know that the ratio of patients and doctors are very high so, there is a requirement of
such kind of applications to help in case of emergency.
This paper proposed a novel approach for medical needs, as well as the suggested
chatbot that will be useful in the pandemic circumstances. Natural Language
Processing (NLP) based applications are proposed to provide help to the patient. In
some situations, the patient home member just used it to type their query and if the
patient situation is not so serious, so they get proper medicinal information from this
application.
The proposed methodology takes an input sentence then its tokenization, removal of
stop words, feature extraction, and word corpus are used to find the sentence
similarity, and the chatbot predicts the accurate sentence.
Keywords: Chatbot, Healthcare, Natural Language Processing, Emergency, Patient,
Doctor.
3
Introduction
• Chatbot is a computer program that simulates human conversion
through Artificial Intelligence.
• Natural Language Processing (NLP) is an essential component of
Artificial Intelligence that can understand human language and makes
computers perform useful tasks with human language.
• Current approaches of NLP are based on Machine Learning.
• The input and output of an NLP can be Text or Speech.
4
Need for Chatbot
• Widespread use of personal machines.
• Better Human-Computer Interaction.
• To express their interest, wishes, or queries directly and naturally, by
speaking, typing, and pointing.
• Due to the pandemic situation Doctors as well as patients avoid
visiting.
5
Literature Survey
• ELIZA & PARRY
• Developed in the 1960 and 1972s
• Simulated a paranoid schizophrenic
• Chatbot for Psychiatric Counseling in Mental Healthcare Service
Based on Emotional Dialogue Analysis and Sentence Generation
[1].
6
Literature Survey
Contd..
• Oh et al. (2017) [2], provides chat service for psychiatric counseling based on high-level natural language
understanding and a multi-modal approach. This study is based on the perception of emotional separation
using artificial intelligence methods.
• Setiaji et al. (2016) [3], implement a chatbot to create a conversation between a person and a machine.
The information is stored in database for identifying the correct sentence and predicting the answer of the
question.
• Dahiya (2017) [4], developed a chatbot that is used pattern comparisons where sentence structure is
detected and a response pattern is maintained.
• Shabariram et al. (2017) [5], build a chatbot application using the XML-based dataset, and the K-Means
is used for clustering with required attributes.
• Dharwadkar et al. (2018) [6], have built a chatbot for health care purposes for the android operating
system.
• Naaz et al. (2017) [7], work used the N-Gram-based and low-dimensional demonstration (LSI-SVD)
approach for detecting duplicate and closest to duplicate documents and it is implemented using c#.net.
• Hormansyah et al. (2018) [8], Designed the chatbot for customer service as a public health service. N-
gram, TF-IDF, and cosine similarity are used in the programme
• Gupta et al. (2021) [14] built a chatbot using RASA framework. This system takes symptoms as input and
predicts the disease with recommended treatments.
7
Methodology
8
Methodology
Contd..
9
Implementation Output
10
Result
• Since our work related to the optimizer for Neural Network.
We used Adam and SGD for this thing.
The optimization algorithm (or optimizer) is the main approach used
today for training a machine learning model to minimize its error
rate.
• There are two metrics to determine the efficacy of an optimizer:
speed of convergence (the process of reaching a global optimum for
gradient descent); and generalization (the model’s performance on
new data). Popular algorithms such as Adaptive Moment Estimation
(Adam) or Stochastic Gradient Descent (SGD) can capably cover one
or the other metric.
11
Result
Contd..
• Gradient descent is the most common
method used to optimize deep learning
networks. It can update each parameter of
a model, observe how a change would
affect the objective function, choose a
direction that would lower the error rate,
and continue iterating until the objective
function converges to the minimum.
• SGD is a variant of gradient descent.
Instead of performing computations on
the whole dataset - which is redundant
and inefficient - SGD only computes on a
small subset or random selection of data
examples. SGD produces the same
performance as regular gradient descent
when the learning rate is low.
• Essentially Adam is an algorithm for
gradient-based optimization of stochastic
objective functions. It combines the
advantages of two SGD extensions - Root
Mean Square Propagation (RMSProp) and
Adaptive Gradient Algorithm (AdaGrad) -
and computes individual adaptive learning
rates for different parameters.
12
Result
Contd..
Lr-value Decay
Responses out of
15
Accuracy Status
0.01 1e-6 8 53% Average
0.05 1e-6 0 0% Wrong Response
1 1e-6 0 0% No Response
1.01 1e-6 Error Nil Error
1.05 1e-6 Out of range Nil Out of Range
0.001 1e-6 7 46% Alternate Correct Response
0.099 1e-6 0 0% No Response
0.0099 1e-6 11 73% Moderate
0.01 1e-10 8 53% Average
0.05 1e-10 0 0% No Answer
1 1e-10 Error Nil Error
1.01 1e-10 0 0% No Response
1.05 1e-10 0 0% No Response
0.001 1e-10 7 46% Not Feasible
0.099 1e-10 0 0% No Response
0.0099 1e-10 13 86% Better
SGD Optimizer 13
Result Contd..
Learning_rate Responses out of 15 Accuracy Status
0.01 13 86% Better
0.05 1 6% No Response
1 0 0% No Response
1.01 0 0% No Response
1.05 0 0% No Response
0.001 Error Nil Index Error
0.099 0 0% No Response
0.0099 14 93% Best
Adam Optimizer
14
Result
Contd..
Comparison between SGD and ADAM optimizers
Optimizers Learning rate Accuracy
SGD 0.0099 86%
SGD 0.01 53%
ADAM 0.0099 93%
ADAM 0.01 86%
ADAGRAD [Desai
(2020)] [18]
0.01 89.63%
15
Conclusion
• Chatbot was developed using a deep neural network with an Adam
optimizer learning rate of 0.0099 is better than other approaches.
• Simple Chatbot develop using Python and NLTK library.
• Work can be extended if we add some security features also data
privacy for the patients.
• For better satisfactory results, we can add additional features to
recognize the human emotions and sentiments of the patient so that
our machine can predict actual problems and solutions.
16
References
1. A. R.W. Tjiptomongsoguno, A. Chen, H.M. Sanyoto, E. Irwansyah, B. Kanigoro, “Medical Chatbot Techniques: A Review,” Software Engineering Perspectives in Intelligent
Systems, CoMeSySo 2020, Advances in Intelligent Systems and Computing, 2020, vol 1294. Springer, Cham, https://doi.org/10.1007/978-3-030-63322-6_28.
2. K. Oh, D. Lee, B. Ko and H. Choi, "A Chatbot for Psychiatric Counseling in Mental Healthcare Service Based on Emotional Dialogue Analysis and Sentence Generation," 2017
18th IEEE International Conference on Mobile Data Management (MDM), 2017, pp. 371-375, https://doi.org/10.1109/MDM.2017.64.
3. B. Setiaji and F. W. Wibowo, “Chatbot Using a Knowledge in Database: Human-to-Machine Conversation Modeling,” 2016 7th International Conference on Intelligent Systems,
Modelling and Simulation (ISMS), 2016, https://doi.org/10.1109/ISMS.2016.53.
4. M. Dahiya, “A Tool of Conversation: Chatbot. International Journal of Computer Sciences and Engineering, International Journal of Computer Sciences and Engineering, 2017,
Volume-5, Issue-5, E-ISSN: 2347-2693, pp 158-161.
5. C.P. Shabariram, V. Srinath, C.S. Indhuja and M. Vidhya, “Ratatta: Chatbot Application Using Expert System,” International Journal of Advanced Research in Computer Science
and Software Engineering, 2017.
6. R. Dharwadkar, N. A. Deshpande, “A Medical Chatbot, International Journal of Computer Trends and Technology (IJCTT),” Volume 60, Issue 1, 2018,
https://doi.org/10.14445/22312803/IJCTT-V60P106.
7. F. Naaz and F. Siddiqui, “Modified N-gram Based Model for Identifying and Filtering Near-Duplicate Documents Detection,” International Journal of Advanced Computational
Engineering and Networking, 2017, ISSN: 2320- 2106, Volume-5, Issue-10.
8. D. S. Hormansyah, E.L. Amalia, L. Affandi., D.W. Wibowo and I. Aulia, “N-gram Accuracy Analysis in the Method of Chatbot Response,” International Journal of Engineering
& Technology, 2018, https://doi.org/10.14419/ijet.v7i4.44.26973.
9. V. K. Shukla and A. Verma, "Enhancing LMS Experience through AIML Base and Retrieval Base Chatbot using R Language," 2019 International Conference on Automation,
Computational and Technology Management (ICACTM), 2019, pp. 561-567, https://doi.org/10.1109/ICACTM.2019.8776684.
17
References
10. M. G, "Mega Bot - The Healthcare Chatbot," 2021 Second International Conference on Electronics and Sustainable Communication Systems (ICESC), 2021, pp. 1386-1395,
https://doi.org/10.1109/ICESC51422.2021.9533025.
11. P. Anandan, S. Kokila, S. Elango, P. Gopinath and P. Sudarsan, "Artificial Intelligence based Chat Bot for Patient Health Care," 2022 International Conference on Computer
Communication and Informatics (ICCCI), 2022, pp. 1-4, https://doi.org/10.1109/ICCCI54379.2022.9740912.
12. P. Kandpal, K. Jasnani, R. Raut and S. Bhorge, "Contextual Chatbot for Healthcare Purposes (using Deep Learning)," 2020 Fourth World Conference on Smart Trends in
Systems, Security and Sustainability (WorldS4), 2020, pp. 625-634, https://doi.org/10.1109/WorldS450073.2020.9210351.
13. D. Madhu, C. J. N. Jain, E. Sebastain, S. Shaji and A. Ajayakumar, "A Novel Approach for Medical Assistance Using Trained Chatbot," 2017 International Conference on
Inventive Communication and Computational Technologies (ICICCT), 2017, pp. 243-246, https://doi.org/10.1109/ICICCT.2017.7975195.
14. J. Gupta, V. Singh and I. Kumar, "Florence- A Health Care Chatbot," 2021 7th International Conference on Advanced Computing and Communication Systems (ICACCS), 2021,
pp. 504-508, https://doi.org/10.1109/ICACCS51430.2021.9442006.
15. P. Srivastava and N. Singh, "Automatized Medical Chatbot (Medibot)," 2020 International Conference on Power Electronics & IoT Applications in Renewable Energy and its
Control (PARC), 2020, pp. 351-354, https://doi.org/10.1109/PARC49193.2020.236624.
16. A. V. Srinivasan, “Stochastic Gradient Descent-Clearly Explained !!” Medium, towardsdatascience.com, 7 Sept. 2019, https://towardsdatascience.com/stochastic-gradient-
descent-clearly-explained-53d239905d31.
17. K. Pykes, “Adam Optimization Algorithm. An Effective Optimization Algorithm | by Kurtis Pykes | Towards Data Science.” Medium, towardsdatascience.com, 6 June 2020,
https://towardsdatascience.com/adam-optimization-algorithm-1cdc9b12724a.
18. C. Desai, “Comparative Analysis of Optimizers in Deep Neural Networks,” 2020, https://www.researchgate.net/publication/ 345381779_Comparative_Analysis_of_
Optimizers_in_Deep_Neural_Networks.
18
Thank You
19

Health Care Chatbot using Natural Language Processing (Final).pptx

  • 1.
    2022 IEEE WorldConference on Applied Intelligence and Computing Health Care Chatbot using Natural Language Processing with SGD and ADAM Optimizer Parameter Optimization (Paper ID-587) Authors Name Kailash Chandra Bandhu, Binod Kumar Mishra, Narottam Choyal, Prakhar Varathe, Mohit Patel & Priya Koushal Department of Computer Science and Engineering Medi-Caps University Indore, India Presented by Binod Kumar Mishra & Kailash Chandra Bandhu 1
  • 2.
    Contents • Abstract • Introduction •Literature Survey • Methodology • Implementation Output • Result • Conclusion • References 2
  • 3.
    Abstract In today’s world,everyone is not quite sure about the medicine that the users used in a similar situation or critical situation where any medical emergency has come and as all know that the ratio of patients and doctors are very high so, there is a requirement of such kind of applications to help in case of emergency. This paper proposed a novel approach for medical needs, as well as the suggested chatbot that will be useful in the pandemic circumstances. Natural Language Processing (NLP) based applications are proposed to provide help to the patient. In some situations, the patient home member just used it to type their query and if the patient situation is not so serious, so they get proper medicinal information from this application. The proposed methodology takes an input sentence then its tokenization, removal of stop words, feature extraction, and word corpus are used to find the sentence similarity, and the chatbot predicts the accurate sentence. Keywords: Chatbot, Healthcare, Natural Language Processing, Emergency, Patient, Doctor. 3
  • 4.
    Introduction • Chatbot isa computer program that simulates human conversion through Artificial Intelligence. • Natural Language Processing (NLP) is an essential component of Artificial Intelligence that can understand human language and makes computers perform useful tasks with human language. • Current approaches of NLP are based on Machine Learning. • The input and output of an NLP can be Text or Speech. 4
  • 5.
    Need for Chatbot •Widespread use of personal machines. • Better Human-Computer Interaction. • To express their interest, wishes, or queries directly and naturally, by speaking, typing, and pointing. • Due to the pandemic situation Doctors as well as patients avoid visiting. 5
  • 6.
    Literature Survey • ELIZA& PARRY • Developed in the 1960 and 1972s • Simulated a paranoid schizophrenic • Chatbot for Psychiatric Counseling in Mental Healthcare Service Based on Emotional Dialogue Analysis and Sentence Generation [1]. 6
  • 7.
    Literature Survey Contd.. • Ohet al. (2017) [2], provides chat service for psychiatric counseling based on high-level natural language understanding and a multi-modal approach. This study is based on the perception of emotional separation using artificial intelligence methods. • Setiaji et al. (2016) [3], implement a chatbot to create a conversation between a person and a machine. The information is stored in database for identifying the correct sentence and predicting the answer of the question. • Dahiya (2017) [4], developed a chatbot that is used pattern comparisons where sentence structure is detected and a response pattern is maintained. • Shabariram et al. (2017) [5], build a chatbot application using the XML-based dataset, and the K-Means is used for clustering with required attributes. • Dharwadkar et al. (2018) [6], have built a chatbot for health care purposes for the android operating system. • Naaz et al. (2017) [7], work used the N-Gram-based and low-dimensional demonstration (LSI-SVD) approach for detecting duplicate and closest to duplicate documents and it is implemented using c#.net. • Hormansyah et al. (2018) [8], Designed the chatbot for customer service as a public health service. N- gram, TF-IDF, and cosine similarity are used in the programme • Gupta et al. (2021) [14] built a chatbot using RASA framework. This system takes symptoms as input and predicts the disease with recommended treatments. 7
  • 8.
  • 9.
  • 10.
  • 11.
    Result • Since ourwork related to the optimizer for Neural Network. We used Adam and SGD for this thing. The optimization algorithm (or optimizer) is the main approach used today for training a machine learning model to minimize its error rate. • There are two metrics to determine the efficacy of an optimizer: speed of convergence (the process of reaching a global optimum for gradient descent); and generalization (the model’s performance on new data). Popular algorithms such as Adaptive Moment Estimation (Adam) or Stochastic Gradient Descent (SGD) can capably cover one or the other metric. 11
  • 12.
    Result Contd.. • Gradient descentis the most common method used to optimize deep learning networks. It can update each parameter of a model, observe how a change would affect the objective function, choose a direction that would lower the error rate, and continue iterating until the objective function converges to the minimum. • SGD is a variant of gradient descent. Instead of performing computations on the whole dataset - which is redundant and inefficient - SGD only computes on a small subset or random selection of data examples. SGD produces the same performance as regular gradient descent when the learning rate is low. • Essentially Adam is an algorithm for gradient-based optimization of stochastic objective functions. It combines the advantages of two SGD extensions - Root Mean Square Propagation (RMSProp) and Adaptive Gradient Algorithm (AdaGrad) - and computes individual adaptive learning rates for different parameters. 12
  • 13.
    Result Contd.. Lr-value Decay Responses outof 15 Accuracy Status 0.01 1e-6 8 53% Average 0.05 1e-6 0 0% Wrong Response 1 1e-6 0 0% No Response 1.01 1e-6 Error Nil Error 1.05 1e-6 Out of range Nil Out of Range 0.001 1e-6 7 46% Alternate Correct Response 0.099 1e-6 0 0% No Response 0.0099 1e-6 11 73% Moderate 0.01 1e-10 8 53% Average 0.05 1e-10 0 0% No Answer 1 1e-10 Error Nil Error 1.01 1e-10 0 0% No Response 1.05 1e-10 0 0% No Response 0.001 1e-10 7 46% Not Feasible 0.099 1e-10 0 0% No Response 0.0099 1e-10 13 86% Better SGD Optimizer 13
  • 14.
    Result Contd.. Learning_rate Responsesout of 15 Accuracy Status 0.01 13 86% Better 0.05 1 6% No Response 1 0 0% No Response 1.01 0 0% No Response 1.05 0 0% No Response 0.001 Error Nil Index Error 0.099 0 0% No Response 0.0099 14 93% Best Adam Optimizer 14
  • 15.
    Result Contd.. Comparison between SGDand ADAM optimizers Optimizers Learning rate Accuracy SGD 0.0099 86% SGD 0.01 53% ADAM 0.0099 93% ADAM 0.01 86% ADAGRAD [Desai (2020)] [18] 0.01 89.63% 15
  • 16.
    Conclusion • Chatbot wasdeveloped using a deep neural network with an Adam optimizer learning rate of 0.0099 is better than other approaches. • Simple Chatbot develop using Python and NLTK library. • Work can be extended if we add some security features also data privacy for the patients. • For better satisfactory results, we can add additional features to recognize the human emotions and sentiments of the patient so that our machine can predict actual problems and solutions. 16
  • 17.
    References 1. A. R.W.Tjiptomongsoguno, A. Chen, H.M. Sanyoto, E. Irwansyah, B. Kanigoro, “Medical Chatbot Techniques: A Review,” Software Engineering Perspectives in Intelligent Systems, CoMeSySo 2020, Advances in Intelligent Systems and Computing, 2020, vol 1294. Springer, Cham, https://doi.org/10.1007/978-3-030-63322-6_28. 2. K. Oh, D. Lee, B. Ko and H. Choi, "A Chatbot for Psychiatric Counseling in Mental Healthcare Service Based on Emotional Dialogue Analysis and Sentence Generation," 2017 18th IEEE International Conference on Mobile Data Management (MDM), 2017, pp. 371-375, https://doi.org/10.1109/MDM.2017.64. 3. B. Setiaji and F. W. Wibowo, “Chatbot Using a Knowledge in Database: Human-to-Machine Conversation Modeling,” 2016 7th International Conference on Intelligent Systems, Modelling and Simulation (ISMS), 2016, https://doi.org/10.1109/ISMS.2016.53. 4. M. Dahiya, “A Tool of Conversation: Chatbot. International Journal of Computer Sciences and Engineering, International Journal of Computer Sciences and Engineering, 2017, Volume-5, Issue-5, E-ISSN: 2347-2693, pp 158-161. 5. C.P. Shabariram, V. Srinath, C.S. Indhuja and M. Vidhya, “Ratatta: Chatbot Application Using Expert System,” International Journal of Advanced Research in Computer Science and Software Engineering, 2017. 6. R. Dharwadkar, N. A. Deshpande, “A Medical Chatbot, International Journal of Computer Trends and Technology (IJCTT),” Volume 60, Issue 1, 2018, https://doi.org/10.14445/22312803/IJCTT-V60P106. 7. F. Naaz and F. Siddiqui, “Modified N-gram Based Model for Identifying and Filtering Near-Duplicate Documents Detection,” International Journal of Advanced Computational Engineering and Networking, 2017, ISSN: 2320- 2106, Volume-5, Issue-10. 8. D. S. Hormansyah, E.L. Amalia, L. Affandi., D.W. Wibowo and I. Aulia, “N-gram Accuracy Analysis in the Method of Chatbot Response,” International Journal of Engineering & Technology, 2018, https://doi.org/10.14419/ijet.v7i4.44.26973. 9. V. K. Shukla and A. Verma, "Enhancing LMS Experience through AIML Base and Retrieval Base Chatbot using R Language," 2019 International Conference on Automation, Computational and Technology Management (ICACTM), 2019, pp. 561-567, https://doi.org/10.1109/ICACTM.2019.8776684. 17
  • 18.
    References 10. M. G,"Mega Bot - The Healthcare Chatbot," 2021 Second International Conference on Electronics and Sustainable Communication Systems (ICESC), 2021, pp. 1386-1395, https://doi.org/10.1109/ICESC51422.2021.9533025. 11. P. Anandan, S. Kokila, S. Elango, P. Gopinath and P. Sudarsan, "Artificial Intelligence based Chat Bot for Patient Health Care," 2022 International Conference on Computer Communication and Informatics (ICCCI), 2022, pp. 1-4, https://doi.org/10.1109/ICCCI54379.2022.9740912. 12. P. Kandpal, K. Jasnani, R. Raut and S. Bhorge, "Contextual Chatbot for Healthcare Purposes (using Deep Learning)," 2020 Fourth World Conference on Smart Trends in Systems, Security and Sustainability (WorldS4), 2020, pp. 625-634, https://doi.org/10.1109/WorldS450073.2020.9210351. 13. D. Madhu, C. J. N. Jain, E. Sebastain, S. Shaji and A. Ajayakumar, "A Novel Approach for Medical Assistance Using Trained Chatbot," 2017 International Conference on Inventive Communication and Computational Technologies (ICICCT), 2017, pp. 243-246, https://doi.org/10.1109/ICICCT.2017.7975195. 14. J. Gupta, V. Singh and I. Kumar, "Florence- A Health Care Chatbot," 2021 7th International Conference on Advanced Computing and Communication Systems (ICACCS), 2021, pp. 504-508, https://doi.org/10.1109/ICACCS51430.2021.9442006. 15. P. Srivastava and N. Singh, "Automatized Medical Chatbot (Medibot)," 2020 International Conference on Power Electronics & IoT Applications in Renewable Energy and its Control (PARC), 2020, pp. 351-354, https://doi.org/10.1109/PARC49193.2020.236624. 16. A. V. Srinivasan, “Stochastic Gradient Descent-Clearly Explained !!” Medium, towardsdatascience.com, 7 Sept. 2019, https://towardsdatascience.com/stochastic-gradient- descent-clearly-explained-53d239905d31. 17. K. Pykes, “Adam Optimization Algorithm. An Effective Optimization Algorithm | by Kurtis Pykes | Towards Data Science.” Medium, towardsdatascience.com, 6 June 2020, https://towardsdatascience.com/adam-optimization-algorithm-1cdc9b12724a. 18. C. Desai, “Comparative Analysis of Optimizers in Deep Neural Networks,” 2020, https://www.researchgate.net/publication/ 345381779_Comparative_Analysis_of_ Optimizers_in_Deep_Neural_Networks. 18
  • 19.