SlideShare a Scribd company logo
1 of 13
Use of Sentiment Analysis via
trained set, in message sent to
Facebook messenger bot
created via AWS
lambda/Stamplay.
Introduction
We have created a Facebook messenger bot. Bot doesn’t know how to
respond according to situations but we have to find the general idea.
So we are introducing the Sentiment Analysis on the message and
figure out the proper response according to the user message and
record the overall response or attitude towards the bot.
Why bots ?
~90% of our time on mobile is spent on email and
messaging platforms
3rd generation platform
• Bots: New Apps
• Voice: User Interface
• AI: Protocol (linguistic analysis, image recognition, concept inference,
sentiment analysis, text enrichments and many other techniques)
• Messaging Apps: Browsers (Slack, Skype or Facebook Messenger)
Basic Idea/Features
The basic idea is to create a bot that can respond to human sentiments
and also provide the feedback to us if the bot is receiving positive or
negative response. Bot could send message to user according to their
response.
We are using “Sentiwordnet” and java to figure out the sentiment.
Sentiwordnet is a huge training set, that contain the words , stemmed
words and phrases with their corresponding positive and/or negative
value.
Dataset/Source
There are 3 sources for data.
1) SentiWordText
We can consider the sentiwordtext as the training set data, We have altered
the sentiwordtext in several places for to make more suitable for out purpose.
It is stored in Amazon S3, to make it accessible from AWS lambda.
2) User Message to bot
The test set here is the message the user sends to the messenger. We compare
the phrase and word again set in sentiwordtext to get the sentiment value of
the message and process it.
3) AWS DynamoDB
The messages and the calculated sentiment is saved in the dynamodb along
with userid, so later it can be scanned easily to get the particular user’s data.
Data Source Attribute
• Sentiwordnet: Sentiwordnet had 6 attributes namely, POS, ID,
PosScore, NegScore, SynsetTerms, Gloss. We used java to isolate the
word from Sysset Terms and stored the PosScore and NegScore for
the word. They are all textual file in tab separated format
• User Message: User message consisted of many attribute in JSON
format, We are interested in message and facebook userId.
• AWS DynamoDB: dynamodb is NOSql, so there are no fix schema,
how ever we created object with attributes. ID which is primary key
and unique(set it as timestamp), facebookID (secondary key, used for
searching),message and sentiment value.
Tools
There are lots of tools involved in this project
1) Facebook Messenger bot: The tool which is used to interact with user and get the
input data to calculate the sentiment.
2) Stamplay: A online tool used to get the message from bot and perform the AWS
lambda function. After the lambda function return result, carryout corresponding
reply.
3) AWS lambda: Functionality provided by Amazon web services, by the means of which
we can perform java code in Amazon server without having to get much server time.
4) Sentiwordnet: The trained set text file that contains the trained set with the stemmed
words and their corresponding sentiment value.
5) AWS DynamoDb: The NOSql database by Amazon, where we store message, its value
and user id
6) AWS S3: The Amazon storeage facility, where the sentiwordnet is stored. Lambda uses
this service to get sentiwordnet.txt
Messenger
Messages
idPK
FBid
msg
Sentiwordnet
Stamplay
S3
Lambda function
“I’m very happy today”
Webhook
“I’m very happy today”
, ,”I’m very happy today, 0.87)
getSentiment(“I’m very happy today”,
getScore(“I’m happy today)
sentiment
Analysis/Algorithm
For the purpose of analyzing the words, we are using Bag of Words
Approach, where most common words are assigned certain value. The
sentiwordnet training set created a hash of the words with vector
about the stemmed word and the value of sentiment it represents. We
the use the data and compare it against the hash and we find the
sentiment value for a given phrase.
The value is then measured against the values set for positive, negative,
and neutral response. The messages are all saved with their
corresponding sentiment value.
Certain trigger word currently “recommend” will get the data from the
database, and calculate the average for the messages and return
proper phrase to send to user. Stamplay sends the message to user
SentiWordnet
WordNet is lexical database which groups the synonyms of words
namely, synsets. SENTIWORDNET 3.0 glosses from the Princeton
WordNet Gloss Corpus, according to which a gloss is actually a
sequence of WORDNET synsets, thus based on “bag of synsets” model,
unlike the “bag of words” approach in previous version.
Basically how it populates its data is, it gets positive and negative
synsets for a synset within certain k distance from itself. The glosses
are used to classify the positive,negative or neutral rating for the
synset.
http://sentiwordnet.isti.cnr.it/
Result
We hope the result would be a smarter bot which will be able to
respond according to users current sentiment. Finding sentiment would
help in better sales pitch, use of softer language, word of appreciation
towards user etc.
The way user interacts with the bot could help us know the feedback
and improve the bot in future according to the feedback.

More Related Content

Similar to Real-time Sentiment Analysis in a Facebook Messenger Bot

Live Twitter Sentiment Analysis and Interactive Visualizations with PyLDAvis ...
Live Twitter Sentiment Analysis and Interactive Visualizations with PyLDAvis ...Live Twitter Sentiment Analysis and Interactive Visualizations with PyLDAvis ...
Live Twitter Sentiment Analysis and Interactive Visualizations with PyLDAvis ...IRJET Journal
 
IBM cognitive service introduction
IBM cognitive service introductionIBM cognitive service introduction
IBM cognitive service introductionHui Wen Han
 
IRJET-Sentiment Analysis in Twitter
IRJET-Sentiment Analysis in TwitterIRJET-Sentiment Analysis in Twitter
IRJET-Sentiment Analysis in TwitterIRJET Journal
 
A review on sentiment analysis and emotion detection.pptx
A review on sentiment analysis and emotion detection.pptxA review on sentiment analysis and emotion detection.pptx
A review on sentiment analysis and emotion detection.pptxvoicemail1
 
Major presentation
Major presentationMajor presentation
Major presentationPS241092
 
AI生成工具的新衝擊 - MS Bing & Google Bard 能否挑戰ChatGPT-4領導地位
AI生成工具的新衝擊 - MS Bing & Google Bard 能否挑戰ChatGPT-4領導地位AI生成工具的新衝擊 - MS Bing & Google Bard 能否挑戰ChatGPT-4領導地位
AI生成工具的新衝擊 - MS Bing & Google Bard 能否挑戰ChatGPT-4領導地位eLearning Consortium 電子學習聯盟
 
Svm and maximum entropy model for sentiment analysis of tweets
Svm and maximum entropy model for sentiment analysis of tweetsSvm and maximum entropy model for sentiment analysis of tweets
Svm and maximum entropy model for sentiment analysis of tweetsS M Raju
 
Emotion detection from text using data mining and text mining
Emotion detection from text using data mining and text miningEmotion detection from text using data mining and text mining
Emotion detection from text using data mining and text miningSakthi Dasans
 
The search engine index
The search engine indexThe search engine index
The search engine indexCJ Jenkins
 
sentimentanaly 2.pdf
sentimentanaly 2.pdfsentimentanaly 2.pdf
sentimentanaly 2.pdfvisheshs4
 
Sentiment Analysis using Twitter Data
Sentiment Analysis using Twitter DataSentiment Analysis using Twitter Data
Sentiment Analysis using Twitter DataHari Prasad
 
Supervised Sentiment Classification using DTDP algorithm
Supervised Sentiment Classification using DTDP algorithmSupervised Sentiment Classification using DTDP algorithm
Supervised Sentiment Classification using DTDP algorithmIJSRD
 
Veda Semantics - introduction document
Veda Semantics - introduction documentVeda Semantics - introduction document
Veda Semantics - introduction documentrajatkr
 
IRJET- Virtual Businessman
IRJET-  	  Virtual BusinessmanIRJET-  	  Virtual Businessman
IRJET- Virtual BusinessmanIRJET Journal
 

Similar to Real-time Sentiment Analysis in a Facebook Messenger Bot (20)

Live Twitter Sentiment Analysis and Interactive Visualizations with PyLDAvis ...
Live Twitter Sentiment Analysis and Interactive Visualizations with PyLDAvis ...Live Twitter Sentiment Analysis and Interactive Visualizations with PyLDAvis ...
Live Twitter Sentiment Analysis and Interactive Visualizations with PyLDAvis ...
 
IBM cognitive service introduction
IBM cognitive service introductionIBM cognitive service introduction
IBM cognitive service introduction
 
Aman chaudhary
 Aman chaudhary Aman chaudhary
Aman chaudhary
 
IRJET-Sentiment Analysis in Twitter
IRJET-Sentiment Analysis in TwitterIRJET-Sentiment Analysis in Twitter
IRJET-Sentiment Analysis in Twitter
 
A review on sentiment analysis and emotion detection.pptx
A review on sentiment analysis and emotion detection.pptxA review on sentiment analysis and emotion detection.pptx
A review on sentiment analysis and emotion detection.pptx
 
Major presentation
Major presentationMajor presentation
Major presentation
 
NetBase API Data Sheet
NetBase API Data SheetNetBase API Data Sheet
NetBase API Data Sheet
 
AI生成工具的新衝擊 - MS Bing & Google Bard 能否挑戰ChatGPT-4領導地位
AI生成工具的新衝擊 - MS Bing & Google Bard 能否挑戰ChatGPT-4領導地位AI生成工具的新衝擊 - MS Bing & Google Bard 能否挑戰ChatGPT-4領導地位
AI生成工具的新衝擊 - MS Bing & Google Bard 能否挑戰ChatGPT-4領導地位
 
Svm and maximum entropy model for sentiment analysis of tweets
Svm and maximum entropy model for sentiment analysis of tweetsSvm and maximum entropy model for sentiment analysis of tweets
Svm and maximum entropy model for sentiment analysis of tweets
 
Emotion detection from text using data mining and text mining
Emotion detection from text using data mining and text miningEmotion detection from text using data mining and text mining
Emotion detection from text using data mining and text mining
 
The search engine index
The search engine indexThe search engine index
The search engine index
 
sentimentanaly 2.pdf
sentimentanaly 2.pdfsentimentanaly 2.pdf
sentimentanaly 2.pdf
 
Sentiment Analysis using Twitter Data
Sentiment Analysis using Twitter DataSentiment Analysis using Twitter Data
Sentiment Analysis using Twitter Data
 
Supervised Sentiment Classification using DTDP algorithm
Supervised Sentiment Classification using DTDP algorithmSupervised Sentiment Classification using DTDP algorithm
Supervised Sentiment Classification using DTDP algorithm
 
P1803018289
P1803018289P1803018289
P1803018289
 
Veda Semantics - introduction document
Veda Semantics - introduction documentVeda Semantics - introduction document
Veda Semantics - introduction document
 
Sentiment analysis
Sentiment analysisSentiment analysis
Sentiment analysis
 
Sentimental analysis
Sentimental analysisSentimental analysis
Sentimental analysis
 
IRJET- Virtual Businessman
IRJET-  	  Virtual BusinessmanIRJET-  	  Virtual Businessman
IRJET- Virtual Businessman
 
Poster (2)
Poster (2)Poster (2)
Poster (2)
 

Recently uploaded

怎样办理旧金山城市学院毕业证(CCSF毕业证书)成绩单学校原版复制
怎样办理旧金山城市学院毕业证(CCSF毕业证书)成绩单学校原版复制怎样办理旧金山城市学院毕业证(CCSF毕业证书)成绩单学校原版复制
怎样办理旧金山城市学院毕业证(CCSF毕业证书)成绩单学校原版复制vexqp
 
Discover Why Less is More in B2B Research
Discover Why Less is More in B2B ResearchDiscover Why Less is More in B2B Research
Discover Why Less is More in B2B Researchmichael115558
 
Top profile Call Girls In Tumkur [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Tumkur [ 7014168258 ] Call Me For Genuine Models We...Top profile Call Girls In Tumkur [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Tumkur [ 7014168258 ] Call Me For Genuine Models We...nirzagarg
 
怎样办理纽约州立大学宾汉姆顿分校毕业证(SUNY-Bin毕业证书)成绩单学校原版复制
怎样办理纽约州立大学宾汉姆顿分校毕业证(SUNY-Bin毕业证书)成绩单学校原版复制怎样办理纽约州立大学宾汉姆顿分校毕业证(SUNY-Bin毕业证书)成绩单学校原版复制
怎样办理纽约州立大学宾汉姆顿分校毕业证(SUNY-Bin毕业证书)成绩单学校原版复制vexqp
 
Ranking and Scoring Exercises for Research
Ranking and Scoring Exercises for ResearchRanking and Scoring Exercises for Research
Ranking and Scoring Exercises for ResearchRajesh Mondal
 
In Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi Arabia
In Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi ArabiaIn Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi Arabia
In Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi Arabiaahmedjiabur940
 
怎样办理圣地亚哥州立大学毕业证(SDSU毕业证书)成绩单学校原版复制
怎样办理圣地亚哥州立大学毕业证(SDSU毕业证书)成绩单学校原版复制怎样办理圣地亚哥州立大学毕业证(SDSU毕业证书)成绩单学校原版复制
怎样办理圣地亚哥州立大学毕业证(SDSU毕业证书)成绩单学校原版复制vexqp
 
+97470301568>>weed for sale in qatar ,weed for sale in dubai,weed for sale in...
+97470301568>>weed for sale in qatar ,weed for sale in dubai,weed for sale in...+97470301568>>weed for sale in qatar ,weed for sale in dubai,weed for sale in...
+97470301568>>weed for sale in qatar ,weed for sale in dubai,weed for sale in...Health
 
Top profile Call Girls In bhavnagar [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In bhavnagar [ 7014168258 ] Call Me For Genuine Models...Top profile Call Girls In bhavnagar [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In bhavnagar [ 7014168258 ] Call Me For Genuine Models...gajnagarg
 
Top profile Call Girls In Chandrapur [ 7014168258 ] Call Me For Genuine Model...
Top profile Call Girls In Chandrapur [ 7014168258 ] Call Me For Genuine Model...Top profile Call Girls In Chandrapur [ 7014168258 ] Call Me For Genuine Model...
Top profile Call Girls In Chandrapur [ 7014168258 ] Call Me For Genuine Model...gajnagarg
 
Vadodara 💋 Call Girl 7737669865 Call Girls in Vadodara Escort service book now
Vadodara 💋 Call Girl 7737669865 Call Girls in Vadodara Escort service book nowVadodara 💋 Call Girl 7737669865 Call Girls in Vadodara Escort service book now
Vadodara 💋 Call Girl 7737669865 Call Girls in Vadodara Escort service book nowgargpaaro
 
DATA SUMMIT 24 Building Real-Time Pipelines With FLaNK
DATA SUMMIT 24  Building Real-Time Pipelines With FLaNKDATA SUMMIT 24  Building Real-Time Pipelines With FLaNK
DATA SUMMIT 24 Building Real-Time Pipelines With FLaNKTimothy Spann
 
如何办理英国诺森比亚大学毕业证(NU毕业证书)成绩单原件一模一样
如何办理英国诺森比亚大学毕业证(NU毕业证书)成绩单原件一模一样如何办理英国诺森比亚大学毕业证(NU毕业证书)成绩单原件一模一样
如何办理英国诺森比亚大学毕业证(NU毕业证书)成绩单原件一模一样wsppdmt
 
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteedamy56318795
 
Top profile Call Girls In Purnia [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Purnia [ 7014168258 ] Call Me For Genuine Models We...Top profile Call Girls In Purnia [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Purnia [ 7014168258 ] Call Me For Genuine Models We...nirzagarg
 
Reconciling Conflicting Data Curation Actions: Transparency Through Argument...
Reconciling Conflicting Data Curation Actions:  Transparency Through Argument...Reconciling Conflicting Data Curation Actions:  Transparency Through Argument...
Reconciling Conflicting Data Curation Actions: Transparency Through Argument...Bertram Ludäscher
 
Top profile Call Girls In dimapur [ 7014168258 ] Call Me For Genuine Models W...
Top profile Call Girls In dimapur [ 7014168258 ] Call Me For Genuine Models W...Top profile Call Girls In dimapur [ 7014168258 ] Call Me For Genuine Models W...
Top profile Call Girls In dimapur [ 7014168258 ] Call Me For Genuine Models W...gajnagarg
 
Predicting HDB Resale Prices - Conducting Linear Regression Analysis With Orange
Predicting HDB Resale Prices - Conducting Linear Regression Analysis With OrangePredicting HDB Resale Prices - Conducting Linear Regression Analysis With Orange
Predicting HDB Resale Prices - Conducting Linear Regression Analysis With OrangeThinkInnovation
 
Gartner's Data Analytics Maturity Model.pptx
Gartner's Data Analytics Maturity Model.pptxGartner's Data Analytics Maturity Model.pptx
Gartner's Data Analytics Maturity Model.pptxchadhar227
 

Recently uploaded (20)

怎样办理旧金山城市学院毕业证(CCSF毕业证书)成绩单学校原版复制
怎样办理旧金山城市学院毕业证(CCSF毕业证书)成绩单学校原版复制怎样办理旧金山城市学院毕业证(CCSF毕业证书)成绩单学校原版复制
怎样办理旧金山城市学院毕业证(CCSF毕业证书)成绩单学校原版复制
 
Discover Why Less is More in B2B Research
Discover Why Less is More in B2B ResearchDiscover Why Less is More in B2B Research
Discover Why Less is More in B2B Research
 
Top profile Call Girls In Tumkur [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Tumkur [ 7014168258 ] Call Me For Genuine Models We...Top profile Call Girls In Tumkur [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Tumkur [ 7014168258 ] Call Me For Genuine Models We...
 
怎样办理纽约州立大学宾汉姆顿分校毕业证(SUNY-Bin毕业证书)成绩单学校原版复制
怎样办理纽约州立大学宾汉姆顿分校毕业证(SUNY-Bin毕业证书)成绩单学校原版复制怎样办理纽约州立大学宾汉姆顿分校毕业证(SUNY-Bin毕业证书)成绩单学校原版复制
怎样办理纽约州立大学宾汉姆顿分校毕业证(SUNY-Bin毕业证书)成绩单学校原版复制
 
Ranking and Scoring Exercises for Research
Ranking and Scoring Exercises for ResearchRanking and Scoring Exercises for Research
Ranking and Scoring Exercises for Research
 
In Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi Arabia
In Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi ArabiaIn Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi Arabia
In Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi Arabia
 
怎样办理圣地亚哥州立大学毕业证(SDSU毕业证书)成绩单学校原版复制
怎样办理圣地亚哥州立大学毕业证(SDSU毕业证书)成绩单学校原版复制怎样办理圣地亚哥州立大学毕业证(SDSU毕业证书)成绩单学校原版复制
怎样办理圣地亚哥州立大学毕业证(SDSU毕业证书)成绩单学校原版复制
 
+97470301568>>weed for sale in qatar ,weed for sale in dubai,weed for sale in...
+97470301568>>weed for sale in qatar ,weed for sale in dubai,weed for sale in...+97470301568>>weed for sale in qatar ,weed for sale in dubai,weed for sale in...
+97470301568>>weed for sale in qatar ,weed for sale in dubai,weed for sale in...
 
Top profile Call Girls In bhavnagar [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In bhavnagar [ 7014168258 ] Call Me For Genuine Models...Top profile Call Girls In bhavnagar [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In bhavnagar [ 7014168258 ] Call Me For Genuine Models...
 
Top profile Call Girls In Chandrapur [ 7014168258 ] Call Me For Genuine Model...
Top profile Call Girls In Chandrapur [ 7014168258 ] Call Me For Genuine Model...Top profile Call Girls In Chandrapur [ 7014168258 ] Call Me For Genuine Model...
Top profile Call Girls In Chandrapur [ 7014168258 ] Call Me For Genuine Model...
 
Vadodara 💋 Call Girl 7737669865 Call Girls in Vadodara Escort service book now
Vadodara 💋 Call Girl 7737669865 Call Girls in Vadodara Escort service book nowVadodara 💋 Call Girl 7737669865 Call Girls in Vadodara Escort service book now
Vadodara 💋 Call Girl 7737669865 Call Girls in Vadodara Escort service book now
 
Cytotec in Jeddah+966572737505) get unwanted pregnancy kit Riyadh
Cytotec in Jeddah+966572737505) get unwanted pregnancy kit RiyadhCytotec in Jeddah+966572737505) get unwanted pregnancy kit Riyadh
Cytotec in Jeddah+966572737505) get unwanted pregnancy kit Riyadh
 
DATA SUMMIT 24 Building Real-Time Pipelines With FLaNK
DATA SUMMIT 24  Building Real-Time Pipelines With FLaNKDATA SUMMIT 24  Building Real-Time Pipelines With FLaNK
DATA SUMMIT 24 Building Real-Time Pipelines With FLaNK
 
如何办理英国诺森比亚大学毕业证(NU毕业证书)成绩单原件一模一样
如何办理英国诺森比亚大学毕业证(NU毕业证书)成绩单原件一模一样如何办理英国诺森比亚大学毕业证(NU毕业证书)成绩单原件一模一样
如何办理英国诺森比亚大学毕业证(NU毕业证书)成绩单原件一模一样
 
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
 
Top profile Call Girls In Purnia [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Purnia [ 7014168258 ] Call Me For Genuine Models We...Top profile Call Girls In Purnia [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Purnia [ 7014168258 ] Call Me For Genuine Models We...
 
Reconciling Conflicting Data Curation Actions: Transparency Through Argument...
Reconciling Conflicting Data Curation Actions:  Transparency Through Argument...Reconciling Conflicting Data Curation Actions:  Transparency Through Argument...
Reconciling Conflicting Data Curation Actions: Transparency Through Argument...
 
Top profile Call Girls In dimapur [ 7014168258 ] Call Me For Genuine Models W...
Top profile Call Girls In dimapur [ 7014168258 ] Call Me For Genuine Models W...Top profile Call Girls In dimapur [ 7014168258 ] Call Me For Genuine Models W...
Top profile Call Girls In dimapur [ 7014168258 ] Call Me For Genuine Models W...
 
Predicting HDB Resale Prices - Conducting Linear Regression Analysis With Orange
Predicting HDB Resale Prices - Conducting Linear Regression Analysis With OrangePredicting HDB Resale Prices - Conducting Linear Regression Analysis With Orange
Predicting HDB Resale Prices - Conducting Linear Regression Analysis With Orange
 
Gartner's Data Analytics Maturity Model.pptx
Gartner's Data Analytics Maturity Model.pptxGartner's Data Analytics Maturity Model.pptx
Gartner's Data Analytics Maturity Model.pptx
 

Real-time Sentiment Analysis in a Facebook Messenger Bot

  • 1. Use of Sentiment Analysis via trained set, in message sent to Facebook messenger bot created via AWS lambda/Stamplay.
  • 2. Introduction We have created a Facebook messenger bot. Bot doesn’t know how to respond according to situations but we have to find the general idea. So we are introducing the Sentiment Analysis on the message and figure out the proper response according to the user message and record the overall response or attitude towards the bot.
  • 3. Why bots ? ~90% of our time on mobile is spent on email and messaging platforms
  • 4. 3rd generation platform • Bots: New Apps • Voice: User Interface • AI: Protocol (linguistic analysis, image recognition, concept inference, sentiment analysis, text enrichments and many other techniques) • Messaging Apps: Browsers (Slack, Skype or Facebook Messenger)
  • 5.
  • 6. Basic Idea/Features The basic idea is to create a bot that can respond to human sentiments and also provide the feedback to us if the bot is receiving positive or negative response. Bot could send message to user according to their response. We are using “Sentiwordnet” and java to figure out the sentiment. Sentiwordnet is a huge training set, that contain the words , stemmed words and phrases with their corresponding positive and/or negative value.
  • 7. Dataset/Source There are 3 sources for data. 1) SentiWordText We can consider the sentiwordtext as the training set data, We have altered the sentiwordtext in several places for to make more suitable for out purpose. It is stored in Amazon S3, to make it accessible from AWS lambda. 2) User Message to bot The test set here is the message the user sends to the messenger. We compare the phrase and word again set in sentiwordtext to get the sentiment value of the message and process it. 3) AWS DynamoDB The messages and the calculated sentiment is saved in the dynamodb along with userid, so later it can be scanned easily to get the particular user’s data.
  • 8. Data Source Attribute • Sentiwordnet: Sentiwordnet had 6 attributes namely, POS, ID, PosScore, NegScore, SynsetTerms, Gloss. We used java to isolate the word from Sysset Terms and stored the PosScore and NegScore for the word. They are all textual file in tab separated format • User Message: User message consisted of many attribute in JSON format, We are interested in message and facebook userId. • AWS DynamoDB: dynamodb is NOSql, so there are no fix schema, how ever we created object with attributes. ID which is primary key and unique(set it as timestamp), facebookID (secondary key, used for searching),message and sentiment value.
  • 9. Tools There are lots of tools involved in this project 1) Facebook Messenger bot: The tool which is used to interact with user and get the input data to calculate the sentiment. 2) Stamplay: A online tool used to get the message from bot and perform the AWS lambda function. After the lambda function return result, carryout corresponding reply. 3) AWS lambda: Functionality provided by Amazon web services, by the means of which we can perform java code in Amazon server without having to get much server time. 4) Sentiwordnet: The trained set text file that contains the trained set with the stemmed words and their corresponding sentiment value. 5) AWS DynamoDb: The NOSql database by Amazon, where we store message, its value and user id 6) AWS S3: The Amazon storeage facility, where the sentiwordnet is stored. Lambda uses this service to get sentiwordnet.txt
  • 10. Messenger Messages idPK FBid msg Sentiwordnet Stamplay S3 Lambda function “I’m very happy today” Webhook “I’m very happy today” , ,”I’m very happy today, 0.87) getSentiment(“I’m very happy today”, getScore(“I’m happy today) sentiment
  • 11. Analysis/Algorithm For the purpose of analyzing the words, we are using Bag of Words Approach, where most common words are assigned certain value. The sentiwordnet training set created a hash of the words with vector about the stemmed word and the value of sentiment it represents. We the use the data and compare it against the hash and we find the sentiment value for a given phrase. The value is then measured against the values set for positive, negative, and neutral response. The messages are all saved with their corresponding sentiment value. Certain trigger word currently “recommend” will get the data from the database, and calculate the average for the messages and return proper phrase to send to user. Stamplay sends the message to user
  • 12. SentiWordnet WordNet is lexical database which groups the synonyms of words namely, synsets. SENTIWORDNET 3.0 glosses from the Princeton WordNet Gloss Corpus, according to which a gloss is actually a sequence of WORDNET synsets, thus based on “bag of synsets” model, unlike the “bag of words” approach in previous version. Basically how it populates its data is, it gets positive and negative synsets for a synset within certain k distance from itself. The glosses are used to classify the positive,negative or neutral rating for the synset. http://sentiwordnet.isti.cnr.it/
  • 13. Result We hope the result would be a smarter bot which will be able to respond according to users current sentiment. Finding sentiment would help in better sales pitch, use of softer language, word of appreciation towards user etc. The way user interacts with the bot could help us know the feedback and improve the bot in future according to the feedback.