You are on page 1of 10

Language Model for Sarcastic Responses and Healthcare related queries

Kashish Bhagat, Kushagra Sharma, Kushagra Bhatnagar


Department of Computer Science, The North cap University

Abstract
"AI will not replace doctors, but they have to ensure that doctors practice better medicine a higher level of
precision and efficiency."

With the help of chatbots, you will be able to communicate via TEXT or voice interface, and then answer with
the help of artificial intelligence. As a rule, a chatbot to communicate with a real human. Chatbots can used in
аррliсаtiоns, suсh аs e-соmmerсe, сustоmer serviсe, саll сenters, and online games. Chatbots are software
programs designed to interact with the messages received.

Artificial Intelligence (AI) has transformed industries and around the world, and has the potential to
dramatically change the healthcare system, and a variety of other fields as well. Let's imagine that you are
able to analyze the data regarding the patient's clinic visits, medications, laboratory tests and procedures will
be performed.

In this paper we present Asclepius.ai - A language model or a personal healthcare companion that can serve 2
purposes->

• make you laugh sarcastically with your normal questions.


• It will provide information of generic health related queries for disease to the patients.

This healthcare chat bot system can also be used at hospitals as it is capable to provide support. 24 X 7 X 365, it can
answer almost every query fired from the user. It can automatically share the necessary information of leads to the
sales. Patients can also be benefitted from the chatbot by asking several questions in series, he/she will be guided by
the chatbot.

Keywords: Healthcare, Sarcasm, Attention Models, Text-Preprocessing

1. Introduction

In the past few years, the number of self-conscious, text, data has been significantly increased in a variety of social
networks. In the era of the networked world, and the production of structured and unstructured data is growing, and
the fact that most of our knowledge is created and shared on social networks. With the explosion of data that can be
used to make people laugh through the creation of a sarcastic answers to your frequently asked questions.
Natural language processing is used to analyze convinced of the text. It has a variety of applications in the field of text
analysis. One of the most important features is that it helps to understand the emotions behind it, the writer. It is
faced with too many challenges to overcome, and for the detection of sarcasm is one of the most important
challenges.
Sarcasm is a rather unconventional way, by the transmission of a message that is contrary to the context. Data
preprocessing is one of the most important activities to be carried out over a period of many years. Many of the
methods of pre-treatment data, such as tokenization, and lemmatization, and the removal of stop words will be used
by researchers in the field. A lot of studies have been performed in order to determine the sarcasm.
In this paper, we describe our sarcasm plus health queries answers generation module, called “Ascelpus.ai”.
Currently it is an AI based methodology that always responds sarcastically to user statements if the user inputs a
well-formed English Sentence else it analyses the health query related text and then responds to user according to
his/her needs.
To the best of our knowledge, no past work focuses on two language models together.We evaluate response of our
language model in terms of these parameters: (a) Sentiment polarity of the output sequence., (b) Grammatical
Correctness (of the output response)., (c) Nature of the output response (Sarcastic normal input sequences and Health
related output to health-related queries)
2. Literature Review
An Exemplary Basic Method of Sarcasm on Twitter ”proposed by Mondher Bouazizi, Tomoaki
Otsuki Ohtsuki. the twitter data from December 2014 to March 2015 is used to extract a set of features and then use
machine learning techniques to make a distinction. the features are extracted in a way that uses different parts of the
tweets and types of sarcasm. the unplanned forest has a very high accuracy of 83.1%.

It was proposed that “sarcasm be detected through the mechanical learning categories and the legal system
by K. Sentamilselvan, P. Suresh, G K Kamalam, S. Mahendran, D. Aneri. using ambiguous detection databases and pre-data
processing techniques such as data token processing, demolition, foundation and damage. Elements were extracted and
classified using planning categories and legal basis. SVM provides 64% accuracy of SemEval2018-T3-train-taskA.txt provided
with a complex discovery database and the random forest provides 76% accuracy using sensory analysis features in the
sarcasmdetection.txt database.

"Sensitive Emotional Analysis of Sarcasm Disorders in the Transmission of Short Text" proposed by Anukarsh G Prasad;
Sanjana S, Skanda M Bhat, BS Harish. The Twitter API is distributed and basic NLP techniques and feature extensions are
used. comparing all the algorithms of the Gradient incremental scores gives a high accuracy rating of 81.82%.

“A study of comparing algorithms for detecting sarcasm differs according to behavior” proposed by
Ravinder Ahujaa, Shantanu Bansala, Shuvam Prakasha, Karthik Venkataramana, and Alisha Bangab. but this paper only
targets hashtags. factors were divided into sets of four factors namely: 1. Sarcasm as a comparison of concepts (Set 1). 2.
Sarcasm as a complex form of expression (Set 2). 3. Sarcasm as a written form (Set 3). 4. All these features include
(BigFeautreSet). Different feature sets obtained different results with different ML algorithms. In Set - 1 Gradient Descent
provides about 79% accuracy. In Set - 2 Gradient Boosting provides 65.95% accuracy. In Set - 3 Gaussian Naive Bayes
provide 75% accuracy. In Set - 4 Gradient boosting provides 85.71% accuracy.

"MedChatBot: UML-fashioned medical student at the virtual", which was proposed by Hamedullah Kazi, B. S. Chowdhry,
and Zeeshey the Memo was aimed at the creation of a medical chatbot is based on AIML. This chatbot was launched by
using the JAVA-based AIML interpreter with the name of another Chatter of the screen. In this case, you must write a
message, and may contain the name of the disease, and that the name of the disease, with the AIML template. If the
disease is detected, the chatbot provides the user with all the necessary information about the problem.

"Automated Medical Chatbot" proposed by Krishnendu Rarhi, Abhishek Bhattacharya, Abhishek


Mishra, KrishnasisMandal. This discussion was presented using AIML pattern acquisition. In this case, Chatbot will ask a lot
of questions until he is convinced of the disease. and also contains a limit-level concept that will determine the severity of
the problem and link the user directly to the doctor.

“MedicalChatBot” proposed by Mrs. RashmiDharwadkar, Dr. UNeeta A. Deshpande. This chat was processed using NLP
extraction of user input and using the Google API for voicetext and voice conversion. AIML is also used to predict the
disease based on symptoms. A cardiovascular database is taken to predict.

"On a chatbot based on widespread health care" a research paper proposed by Nourch`ene Ouerhani,
AhmedMaleale, and HendaBenGh´ezela. The basic configuration of a chatbot is divided into the following modules: pre-
processor input processor (IPM), native Language Pipe, Storage Module (SM), and Response Engine (RE). use GloVWho is
an uncontrolled learning’.
“The identification of Sarcasm in the texts proposed by Christopher Ifeanyi Eke, A. Norman. In this research paper the n-
gram and Parts-of-speech (POS) were used to exclude feature, binary representation and term frequency were used for
feature representation while Chi squared test and information was developed for the feature selection process. This paper
has used a support vector machine for separation purposes. ”

“SarcasmBot written by Aditya Joshi, according to the proposed paper the butter makes a derogatory response to user
input. It uses mock generators based on 8 rules. These eight rules are used to create the manifestation of Sarcasm. The
user selects one of these 8 rules during operation depending on the user input features such as question type, number of
organizations, etc., This bot is able to detect the mock element in two ways. The accuracy of this bot stands at 70.97% ”

"The diagnosis of Multimodal Sarcasm by Santiago Castro, Devamanyu Hazarika, Verónica Pérez-Rosas, Roger
Zimmermann, Rada Mihalcea, Soujanya Poriaι." The proposed paper finds mockery in video captions. Using SVM as a basic
model, fine C is used as a hyper parameter, selecting between 1,10,30,500,1000.
The pronunciation of the text in the database must be by BERT, which provides sentence representation for all speech.
Using the SVM F1-Score the highest model was 71.6 ”.

“An In-depth Look at Sarcastic Tweets Using Deep Convolutional Neural Networks” proposed by Soujanya Poria, Erik
Cambria, Devamanyu Hazarika, Prateek Vij. 3 different databases are used for emotions, feelings, and personality traits.
CNN and CNN-SVM (where features released from CNN are supplied to SVM) have been applied to these data sets and
CNN-SVM has performed better in all feature integration. accuracy reaches 97.71% of database 1 94.80 of database 2 and
93.30 of database 3.
Dr. Vdoc - medical consultant who works as a physical therapist, the remedy is proposed by Saurav Kumar Mishra,
Drirendra Bharti, Nidhi Mishra. The chatbot is good enough to answer a wide range of questions a user asks about various
diseases. The proposed solutions use NLP and algorithm based on pattern-like and integrated learning to obtain results.
The accuracy of the proposed solution was about 80%

"Self-Diagnosis Medical Chat-Bot Uses Artificial Intelligence" proposed by Ghare Shifa1, Shaikh Sabreen1, Shaikh Tasmia
Bano1, Awab Habib Fakih. SpaCy (NLP library) is used to understand large text volumes. is used to pre-study deep learning
modules and is able to understand many languages such as French, German, Dutch.

"Artificial Intelligence-based Healthcare Chatbot System" proposed by Ashwini Shangrapawar1, Ankita Ravekar2, Sakshi
Kale3, Nidhi Kumari4, Aman Shende5, Pankaj Taklikar. The user will be able to interact with a real bot with features such as
forward, backward, take a rotating clockwise and counter-clockwise. the bot will run from the Android Bluetooth app. the
raspberry pi 2b module is the main controller in this conversation. Input is in speech format which is later converted to
text. input is verified there using a database and google server. finally, the product is produced.
Pharmabot: An interview with pediatric counselor Benilda Eloner, Bien Michael, Jefferson Medenilla and Timothy Bryle. The
proposed solution is most effective for children, can advise the child on medication and can provide the same information.
The solution uses the left and right algorithm to obtain the desired results
Index Name Problem discussed Method/ Results
and solved Algorithm Used
1 A Pattern-Based Approach for Implemented Classification accuracy reached
Sarcasm Detection on Twitter ML and NLP models along 83.1% using the
Algorithms with feature classifier Random
extraction used. Forest

2 Detection on sarcasm using Feature extraction, SVM, decision sarcasmdetection.txt


machine learning classifiers pre-processing tree ,Random (Random Forest – 76%)
and rule- based approach techniques, and forest,gradient
classification boost ,Naïve SemEval2018-T3-train-
algorithm. Bayes taskA.txt
used for 2 (SVM – 64%)
different datasets
3 Sentiment Analysis for Feature extraction, decision tree Gradient boost provides
Sarcasm Detection on pre- ,Random forest, highest accuracy
Streaming Short Text Data processing logistic regression percent i.e., 81.82 %
technique use, ,gradient boost
and classification ,Naïve Bayes,k
algorithm neighbors,

4 comparative study of different including hashtags decision tree Gradient Descent


sarcasm detection algorithms in pre- ,Random forest, Ensemble
based on behavioral approach processing part and logistic regression accuracy- 79%
classification ,gradient boost
algorithm. ,Naïve Bayes,k
neighbors,

5 “Self-Diagnosis Medical Chat- – text extraction – SpaCy , user will be able to have
Bot Using Artificial from large dataset dialog text conversation nothing
Intelligence” flow else.

6 “Artificial Intelligence-based chatbot raspberry pi 2b, moving chatbot giving


Healthcare Chatbot System” connectivity, voice Bluetooth, output through speakers
to text vice versa speaker, google
server, database

7 Pharma Bot: A pediatric The proposed Left and right With the help of bigrams,
generic medicine consultant solution was passing algorithm trigrams and left right
chatbot introduced to was used. parsing algorithm, it
suggest children resulted in fast answering
with medicines from the chatbot.

8 Dr. Vdoc - Medical chatbot Patient can ask Several Machine The proposed solution
that acts as a virtual doctor various information Learning models was able to answer
about different were ensembled queries with around 80%
diseases from the together to get accuracy
chatbot the desired
results.
9 Med chatbot An umls The system has not AIML pattern technique 47% of accuracy
based chatbot for been specially for Pattern matching
medical students designed for the
task of supporting
natural dialog in
chatbots
10 Automated Medical Chat engine for Using AIML 56% of accuracy
Chatbot easy conversation, pattern detection,
medical data category classifiaction
storage

11 A text to voice Google api for text 0.94% of accuracy from


Medical ChatBot to voice, ml algorithm SVM classifier
comparison

12 )Towards a chatbot based The issue here is to Natural Application developed


smart pervasive healthcare maintain storage language pipeline and deployed. First aid is
and responsive (Glove) consisting of pre performed before
engine trained word aid arrives.
embeddings and entity
extractor
intent classifier,
responsive engine, and
storage capacity.
13 The CoachAI App roach Scheduling task Task scheduler, Wearable
and alerts, easy to dialog engine, easy to data integration,
use use dashboard feedback task, activity
suggestion
14 )Sarcasm identification in Identification of User of SVM for Accuracy was 70.97% for
textual data sarcasm in a corpus classification and BOW the proposed model.
of dataset for feature extraction With the help of the eight
rules which were defined

15 SarcasmBot A chatbot which 8 rules were made, for BERT attention model
can reply in the feature extraction was used for the chatbot
sarcastic manner with much better
accuracy than the naive
RNN.
16 Multimodal Sarcasm A chatbot for SVM was used as a Support Vector model
Detection detecting the baseline with penalty C help achieved 78.3%
sarcasm in video as a hyper parameter accurate results.
captions

17 17)A Deeper Look into The purposed CNN was used as a The model achieved
Sarcastic Tweets Using architecture was feature extractor 92.5% accuracy with
Deep Convolutionl used to detected help of stacked conv
Neural Networks sarcasm and irony 2D.
from textual data
3. Methodology

The Proposed Layout:

Data Collection Exploratory Data Data Cleaning Data Pre-


Analysis processing

Error Analysis Models

Error Analysis

In the proposed work, dataset is collected from multiple Kaggle Datasets and GitHub Repositories. The data has
been combined from all these resources. The final data has been divided into two parts:

1. Data for Generating Sarcastic Sequences (Reddit Data): The attributes included in this dataset are Question
asked by the user in the past and the bot responds the jokes generated according to the user's query.

2. Data for patient’s health related queries.

We have considered different models for these 2 scenarios. All models have been compared for each scenario. The
following are the steps involved in the proposed work:

1. Data Collection: The dataset is scraped from Reddit Jokes and combined further with some more jokes data
present on Kaggle and GitHub Repositories.

2. Exploratory Data Analysis: This is performed to help us know what all our data consists about. While performing
this we were able to know length of sentences, number of words per sentence, what type of jokes are present
(removing jokes that can hurt people's sentiments). Calculating the length of the question and length of answer to
that question.

3. Data Cleaning: The actual data consisted of frequent unusual text which would confuse model further for
training, data comprises of tweets from Twitter, mentions from Instagram and data in different format from various
other resources. Our main aim in this process was to generate data for two-way process like separating questions
and answers into different attributes in a machine-readable format.

4. Data pre-processing: Pre-processing has always been an important process for mining real world data and
converting that data into machine readable format. Some of the key features performed in this part are Handling
long and complex sentences, Cleaning data in a suitable format to achieve quicker response time, solving problems
like mixing of local language and slangs.
4. Models

(a). Sarcasm Language Model

The Sarcasm language model is built on Reddit Jokes, using seq2seq model, Encoder and Decoder have LSTM (RNN)
layers and adding attention mechanism to handle long sentences.

Below are discussed all the implemented methodologies in context of our implemented work:
seq2seq models: Seq2Seq is a educational template for the conversion of the sequences from one domain (for
example, in the phrases in the English language) at the end of a different domain (for example, with the same
phrases in French translation).
(b). Healthcare Queries Language model

The medical-chat-bot was built with the help of a set of disease diagnostics.diseases have a range of additional
symptoms.patient must have symptoms and the chatbot allows for the recognition of the disease. Every time that a
person has a certain disease , the human body reacts to it, it is giving the symptoms. Those symptoms may be
indicative of a particular disease.
The system is based on a variety of machine learning algorithms that mimic the human thinking and reasoning. Some
of the Algorithms used are discussed below:

(i) LightGBM classifier: This is a Gradient Boosting system, the use of tree-based learning algorithms, which is a
very powerful algorithm, it's going to make the calculation. This is a fast algorithm. While the trees are of different
algorithms that grow horizontally, the LightGBM system is vertical, which means that it grows on the leaves, and
the other algorithms is to grow to a level. LightGBM-allows you to select one sheet, with a great loss for the future.
It is able to reduce and lose more than that, x-level system for the production of the same sheet of paper.

(ii) AdaBoost classifier: The Ada-boost, or Adaptive Boosting, is one of the encouragement of a group of
classifiers that combine different classifiers to improve the accuracy of the classifiers. AdaBoost is a multi-step
process is a complex procedure. AdaBoost classifier to build a strong classifier, which is a combination of a
number of low-performing classifiers, so that you have an accurate and powerful classifier.

(iii) XGBoost: classifier: It is an open-source library, that allows for a fast implementation of the gradient-
enhanced decision tree. The core is a C++ code base, and combine it with the Python interface is on the top,
this results in a very powerful, yet easy-to-deploy package.

(iv) Decision Trees Classifier: Decision tree learning decision tree induction is one of the predictive
modeling used widely in stats , data mining, and Ml. It makes use of a decision tree, in order to move from
the perception of an object, and to make inferences about the target.

Comparative analysis among all these algorithms have been shown in Results Section.
5. Results
Since the data collected for each language model was different, we will evaluate each language model on separate
metrics.

(a). Sarcastic Language Model

Since the model training was done with attention mechanism, most important metric for evaluating this language
model is bleu score.

What Is bleu score?


BLUE, or bi-lingual Evaluation doubler is an assessment and to compare it with a translation of a text by one or more
of the reference with the transfers. Even though it's designed for it's translation, you can use it to review the text of
a set of natural language processing tasks.

We have categorized our generated output sequence based on 3 types: (a). Bad if bleu score <= 0.35 (b). Medium if
bleu score <= 0.6 (c). else it is a good bleu score

Bleu Score=min (1, output-length/reference-length) (Precision of N-Grams of size 1 to 4)


A detailed analysis on bleu scores have been discussed below:

1. We are dividing the data based on bleu score.


2. Score less than 0.35 is "bad" 0.35-0.6 is "medium" and anything greater is "good"
3. There are 76,000 bad datapoints and 50,000 each medium and good points
4. Can see lowest value 0 and highest value 1. There are very few points with bleu greater 0.75.
5. In "good" category most values are between 0.6 - 0.75

(b). Healthcare Chatbot Language Model


The Input nodes, a group of symptoms, the output nodes are diseases that can be detected by the system based on groups
.The system displays the value of the diseases, for the purpose of calculating a score for all of the symptoms, as well as a
score for all of the diseases and choose the best of diseases, as well as the score is based on a set of symptoms.
Metrics Used for evaluating the language model
Classifier Classification Accuracy F1-Score

Decision Trees Classifier 0.98 0.97


XG-Boost Classifier 0.99 0.96

AdaBoost Classifier 0.25 0.24


LightGBM Classifier 1.0 1.0

6. Conclusion

Being Sarcastic can become a major issue for some, hence we are working on our model to check for sentiment
polarity returned for the output sequence. As we can observe from the literature review, large amount of has
been done in detecting sarcasm, but no one has highlighted the issue for sentiment polarity as there can be
sequences which can hurt people sentiments. However, we might be coming up with something best in the
industry in the futuristic perspective.

You might also like