how can we make a bot to realize - cdn.ymaws.com · how can we make a bot to realize human emotions...

38

Upload: others

Post on 21-May-2020

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: HOW CAN WE MAKE A BOT TO REALIZE - cdn.ymaws.com · HOW CAN WE MAKE A BOT TO REALIZE HUMAN EMOTIONS Ardhendu Samajdwer Luc Bors ... Luc Bors •Partner & Technical Director @eProseed
Page 2: HOW CAN WE MAKE A BOT TO REALIZE - cdn.ymaws.com · HOW CAN WE MAKE A BOT TO REALIZE HUMAN EMOTIONS Ardhendu Samajdwer Luc Bors ... Luc Bors •Partner & Technical Director @eProseed

Copyright © 2014, eProseed and/or its affiliates. All rights reserved. | Highly Restricted

HOW CAN WE MAKE A BOT TO REALIZE HUMAN EMOTIONS

Ardhendu SamajdwerLuc BorsThursday Feb 28th

Page 3: HOW CAN WE MAKE A BOT TO REALIZE - cdn.ymaws.com · HOW CAN WE MAKE A BOT TO REALIZE HUMAN EMOTIONS Ardhendu Samajdwer Luc Bors ... Luc Bors •Partner & Technical Director @eProseed

Copyright © 2015, eProseed and/or its affiliates. All rights reserved. |

Ardhendu Samajdwer• Senior R&D Architect

@eProseed

Luc Bors• Partner & Technical Director

@eProseed

• Oracle ACE Director & Oracle Groundbreaker Ambassador

• Author of Oracle MAF Developer Guide OraclePress

About eProseed• HQ in Luxemburg

• Local offices in several parts of the world

• Award winning Oracle partner

3

Services• Support services

• Hosting, managed services, concierge services, emergency services

• Consultancy services

• End to End projects, Reviews, Training

• Products & Solutions

• FSIP

INTRODUCTION

Page 4: HOW CAN WE MAKE A BOT TO REALIZE - cdn.ymaws.com · HOW CAN WE MAKE A BOT TO REALIZE HUMAN EMOTIONS Ardhendu Samajdwer Luc Bors ... Luc Bors •Partner & Technical Director @eProseed

Copyright © 2015, eProseed and/or its affiliates. All rights reserved. |

AGENDA

Significance of sentiment analysis

Concepts

Approach

A!ermath

Conclusion

1

2

4

3

4

5

Page 5: HOW CAN WE MAKE A BOT TO REALIZE - cdn.ymaws.com · HOW CAN WE MAKE A BOT TO REALIZE HUMAN EMOTIONS Ardhendu Samajdwer Luc Bors ... Luc Bors •Partner & Technical Director @eProseed

Copyright © 2015, eProseed and/or its affiliates. All rights reserved. |

(CHAT)BOTS

5

• Generally speaking a bot is any software that performs an automated task

• A Chatbot is a computer program designed to simulate conversationwith human users, especially over the Internet.

• The biggest misconception that arises is that a chatbot is a bot that converses with a human in the way that another human would converse with a human.

Page 6: HOW CAN WE MAKE A BOT TO REALIZE - cdn.ymaws.com · HOW CAN WE MAKE A BOT TO REALIZE HUMAN EMOTIONS Ardhendu Samajdwer Luc Bors ... Luc Bors •Partner & Technical Director @eProseed

Copyright © 2015, eProseed and/or its affiliates. All rights reserved. |

• Intents• Utterances• Entities• Machine Learning/NLP• Dialog Flow

6

TALKING SOME CHATBOT SLANG

Page 7: HOW CAN WE MAKE A BOT TO REALIZE - cdn.ymaws.com · HOW CAN WE MAKE A BOT TO REALIZE HUMAN EMOTIONS Ardhendu Samajdwer Luc Bors ... Luc Bors •Partner & Technical Director @eProseed

Copyright © 2015, eProseed and/or its affiliates. All rights reserved. |7

Intent

Derived from customer input

What does the user want?

Is this mapped to an action?

Order Pizza

Order Pasta

Cancel Order

“Hi, I want to order a cheese pizza”

WHAT ARE INTENTS?

Page 8: HOW CAN WE MAKE A BOT TO REALIZE - cdn.ymaws.com · HOW CAN WE MAKE A BOT TO REALIZE HUMAN EMOTIONS Ardhendu Samajdwer Luc Bors ... Luc Bors •Partner & Technical Director @eProseed

Copyright © 2015, eProseed and/or its affiliates. All rights reserved. |8

Utterances

Statements that map to intent

“Sample data” for an intent

Not exact string matching

Order Pizza

Order Pasta

Cancel OrderMachine learning

Need many good utterances

WHAT ARE UTTERANCES?

Page 9: HOW CAN WE MAKE A BOT TO REALIZE - cdn.ymaws.com · HOW CAN WE MAKE A BOT TO REALIZE HUMAN EMOTIONS Ardhendu Samajdwer Luc Bors ... Luc Bors •Partner & Technical Director @eProseed

Copyright © 2015, eProseed and/or its affiliates. All rights reserved. |9

Entity

Variable/parameter for intent

Important word in an input

Adds relevance to intent

Order Pizza

“Hi, I want to order a cheese pizza”

Cheese

Pepperoni

HamPossibly maps to domain object

WHAT ARE ENTITIES?

Page 10: HOW CAN WE MAKE A BOT TO REALIZE - cdn.ymaws.com · HOW CAN WE MAKE A BOT TO REALIZE HUMAN EMOTIONS Ardhendu Samajdwer Luc Bors ... Luc Bors •Partner & Technical Director @eProseed

Copyright © 2015, eProseed and/or its affiliates. All rights reserved. |

POTENTIAL PROBLEMS

• In less than one day, the TAY chatbot became racist, homophobic, and a Nazi, just by interacting with users

• Complicated syntax, sarcasm or ambiguous wording

• Chatbot’s sentiment analysis algorithm is not sensitive enough to frustration and does not alert the operator promptly

10

Page 11: HOW CAN WE MAKE A BOT TO REALIZE - cdn.ymaws.com · HOW CAN WE MAKE A BOT TO REALIZE HUMAN EMOTIONS Ardhendu Samajdwer Luc Bors ... Luc Bors •Partner & Technical Director @eProseed

Copyright © 2015, eProseed and/or its affiliates. All rights reserved. |

SIGNIFICANCE OF SENTIMENT ANALYSIS

• React less like a bot, behave more like a human.

• A bot user in a good mood is more likely to complete the conversation.

• An unexpected response from a bot has a higher probability of loosing user from visiting the bot again.

• A bot can resolve intents better if it can sense whether the user is pleased, upset or angry and hence, can be business beneficial.

11

Page 12: HOW CAN WE MAKE A BOT TO REALIZE - cdn.ymaws.com · HOW CAN WE MAKE A BOT TO REALIZE HUMAN EMOTIONS Ardhendu Samajdwer Luc Bors ... Luc Bors •Partner & Technical Director @eProseed

Copyright © 2015, eProseed and/or its affiliates. All rights reserved. |

AGENDA

Significance of sentiment analysis

Concepts

Approach

Aftermath

Conclusion

1

2

12

3

4

5

Page 13: HOW CAN WE MAKE A BOT TO REALIZE - cdn.ymaws.com · HOW CAN WE MAKE A BOT TO REALIZE HUMAN EMOTIONS Ardhendu Samajdwer Luc Bors ... Luc Bors •Partner & Technical Director @eProseed

Copyright © 2015, eProseed and/or its affiliates. All rights reserved. |

CONCEPTS

• Various ways can cater the requirement for sentiment analysis and the desired approach would based on the scope of Digital Assistant.

1. Having predefined set of intents in the Digital Assistant.2. Having a separate Smalltalk with a predefined set of intents.3. Invoking a third party API for sentiment analysis. (Considered for this

presentation)

13

Page 14: HOW CAN WE MAKE A BOT TO REALIZE - cdn.ymaws.com · HOW CAN WE MAKE A BOT TO REALIZE HUMAN EMOTIONS Ardhendu Samajdwer Luc Bors ... Luc Bors •Partner & Technical Director @eProseed

Copyright © 2015, eProseed and/or its affiliates. All rights reserved. |

• IBM Watson Tone Analyzer API– API-KEY and Sentence à Sentiment

• Qemotion (Paid API)– API-KEY and Sentence à Sentiment

• AYLIEN API – API-KEY and Sentence à Sentiment

• PreCeive API (free plan)– API-KEY and Sentence à Sentiment

• MoodPatrol API (Paid API)– API-KEY and Sentence à Sentiment

• Indico API (free plan)– API-KEY and Sentence à Sentiment

• ParallelDots (free plan)– API-KEY and Sentence à Sentiment

14

THIRD PARTY API’S (EXAMPLES)

Page 15: HOW CAN WE MAKE A BOT TO REALIZE - cdn.ymaws.com · HOW CAN WE MAKE A BOT TO REALIZE HUMAN EMOTIONS Ardhendu Samajdwer Luc Bors ... Luc Bors •Partner & Technical Director @eProseed

Copyright © 2015, eProseed and/or its affiliates. All rights reserved. |

AGENDA

Significance of sentiment analysis

Concepts

Approach

Aftermath

Conclusion

1

2

15

3

4

5

Page 16: HOW CAN WE MAKE A BOT TO REALIZE - cdn.ymaws.com · HOW CAN WE MAKE A BOT TO REALIZE HUMAN EMOTIONS Ardhendu Samajdwer Luc Bors ... Luc Bors •Partner & Technical Director @eProseed

Copyright © 2015, eProseed and/or its affiliates. All rights reserved. |

APPROACH

• Invocation of sentiment analysis APIs.

1. Using Oracle Mobile Hub.

2. Using Oracle Application Container Cloud Service (ACCS) i.e. Embedded Container in Oracle Digital Assistant.

16

Page 17: HOW CAN WE MAKE A BOT TO REALIZE - cdn.ymaws.com · HOW CAN WE MAKE A BOT TO REALIZE HUMAN EMOTIONS Ardhendu Samajdwer Luc Bors ... Luc Bors •Partner & Technical Director @eProseed

Copyright © 2015, eProseed and/or its affiliates. All rights reserved. |

APPROACH - ORACLE MOBILE HUB

• Create a REST connector to connect to the remote service.• Create a shared API. (Oracle recommended approach for building multi

channel applications)• Create a custom component service, which will be referred in skill flow, to

connect to shared API. Shared API will then call connector.• Expose the custom component service using Oracle Mobile Hub.• Consume the custom component service in Skill of a Digital Assistant.

17

Page 18: HOW CAN WE MAKE A BOT TO REALIZE - cdn.ymaws.com · HOW CAN WE MAKE A BOT TO REALIZE HUMAN EMOTIONS Ardhendu Samajdwer Luc Bors ... Luc Bors •Partner & Technical Director @eProseed

Copyright © 2015, eProseed and/or its affiliates. All rights reserved. |

STEPS IN THE SOLUTION

Digital Assistant

Custom Component

Custom API (Mobile Hub)

Connector (Mobile Hub)

CloudConnector (Mobile Hub)

Custom API (Mobile Hub)

Custom Component

Digital Assistant

18

Page 19: HOW CAN WE MAKE A BOT TO REALIZE - cdn.ymaws.com · HOW CAN WE MAKE A BOT TO REALIZE HUMAN EMOTIONS Ardhendu Samajdwer Luc Bors ... Luc Bors •Partner & Technical Director @eProseed

Copyright © 2015, eProseed and/or its affiliates. All rights reserved. |

APPROACH - ORACLE MOBILE HUB

• Create a REST connector to connect to the remote service.

19

Page 20: HOW CAN WE MAKE A BOT TO REALIZE - cdn.ymaws.com · HOW CAN WE MAKE A BOT TO REALIZE HUMAN EMOTIONS Ardhendu Samajdwer Luc Bors ... Luc Bors •Partner & Technical Director @eProseed

Copyright © 2015, eProseed and/or its affiliates. All rights reserved. |

APPROACH - ORACLE MOBILE HUB

• Create a REST connector to connect to the remote service.

20

Page 21: HOW CAN WE MAKE A BOT TO REALIZE - cdn.ymaws.com · HOW CAN WE MAKE A BOT TO REALIZE HUMAN EMOTIONS Ardhendu Samajdwer Luc Bors ... Luc Bors •Partner & Technical Director @eProseed

Copyright © 2015, eProseed and/or its affiliates. All rights reserved. |

APPROACH - ORACLE MOBILE HUB

• Create a REST connector to connect to the remote service.

21

Page 22: HOW CAN WE MAKE A BOT TO REALIZE - cdn.ymaws.com · HOW CAN WE MAKE A BOT TO REALIZE HUMAN EMOTIONS Ardhendu Samajdwer Luc Bors ... Luc Bors •Partner & Technical Director @eProseed

Copyright © 2015, eProseed and/or its affiliates. All rights reserved. |

APPROACH - ORACLE MOBILE HUB

• Create a REST connector to connect to the remote service.

22

Page 23: HOW CAN WE MAKE A BOT TO REALIZE - cdn.ymaws.com · HOW CAN WE MAKE A BOT TO REALIZE HUMAN EMOTIONS Ardhendu Samajdwer Luc Bors ... Luc Bors •Partner & Technical Director @eProseed

Copyright © 2015, eProseed and/or its affiliates. All rights reserved. |

APPROACH - ORACLE MOBILE HUB

• Create a shared API.

23

Page 24: HOW CAN WE MAKE A BOT TO REALIZE - cdn.ymaws.com · HOW CAN WE MAKE A BOT TO REALIZE HUMAN EMOTIONS Ardhendu Samajdwer Luc Bors ... Luc Bors •Partner & Technical Director @eProseed

Copyright © 2015, eProseed and/or its affiliates. All rights reserved. |

APPROACH - ORACLE MOBILE HUB

• Create a custom component service.

24

Page 25: HOW CAN WE MAKE A BOT TO REALIZE - cdn.ymaws.com · HOW CAN WE MAKE A BOT TO REALIZE HUMAN EMOTIONS Ardhendu Samajdwer Luc Bors ... Luc Bors •Partner & Technical Director @eProseed

Copyright © 2015, eProseed and/or its affiliates. All rights reserved. |

APPROACH - ORACLE MOBILE HUB

• Oracle Mobile Hub.

25

Page 26: HOW CAN WE MAKE A BOT TO REALIZE - cdn.ymaws.com · HOW CAN WE MAKE A BOT TO REALIZE HUMAN EMOTIONS Ardhendu Samajdwer Luc Bors ... Luc Bors •Partner & Technical Director @eProseed

Copyright © 2015, eProseed and/or its affiliates. All rights reserved. |

APPROACH - ORACLE MOBILE HUB

• Consume the custom component service in Skill of a Digital Assistant.

26

Page 27: HOW CAN WE MAKE A BOT TO REALIZE - cdn.ymaws.com · HOW CAN WE MAKE A BOT TO REALIZE HUMAN EMOTIONS Ardhendu Samajdwer Luc Bors ... Luc Bors •Partner & Technical Director @eProseed

Copyright © 2015, eProseed and/or its affiliates. All rights reserved. |

APPROACH - EMBEDDED CONTAINER

• Create a custom component based on Oracle bots-node-sdk.• Implement logic for invoking external sentiment analysis API in custom

component.• Develop and test in parallel using Oracle Digital Assistant instance and a

tunneling software (example: ngrok).• Import the Custom Component in Digital Assistant instance’s Embedded

Container.

27

Page 28: HOW CAN WE MAKE A BOT TO REALIZE - cdn.ymaws.com · HOW CAN WE MAKE A BOT TO REALIZE HUMAN EMOTIONS Ardhendu Samajdwer Luc Bors ... Luc Bors •Partner & Technical Director @eProseed

Copyright © 2015, eProseed and/or its affiliates. All rights reserved. |

STEPS IN THE SOLUTION

Digital Assistant

Custom Component

External Sentiment API

APICustom Component

Digital Assistant

28

Page 29: HOW CAN WE MAKE A BOT TO REALIZE - cdn.ymaws.com · HOW CAN WE MAKE A BOT TO REALIZE HUMAN EMOTIONS Ardhendu Samajdwer Luc Bors ... Luc Bors •Partner & Technical Director @eProseed

Copyright © 2015, eProseed and/or its affiliates. All rights reserved. |

APPROACH - EMBEDDED CONTAINER

• Create a custom component based on Oracle bots-node-sdk.

29

Page 30: HOW CAN WE MAKE A BOT TO REALIZE - cdn.ymaws.com · HOW CAN WE MAKE A BOT TO REALIZE HUMAN EMOTIONS Ardhendu Samajdwer Luc Bors ... Luc Bors •Partner & Technical Director @eProseed

Copyright © 2015, eProseed and/or its affiliates. All rights reserved. |

APPROACH - EMBEDDED CONTAINER

• Implement logic for invoking external sentiment analysis API in custom component.

30

Page 31: HOW CAN WE MAKE A BOT TO REALIZE - cdn.ymaws.com · HOW CAN WE MAKE A BOT TO REALIZE HUMAN EMOTIONS Ardhendu Samajdwer Luc Bors ... Luc Bors •Partner & Technical Director @eProseed

Copyright © 2015, eProseed and/or its affiliates. All rights reserved. |

APPROACH - EMBEDDED CONTAINER

• Import the Custom Component in Digital Assistant instance’s Embedded Container once ready.

31

Page 32: HOW CAN WE MAKE A BOT TO REALIZE - cdn.ymaws.com · HOW CAN WE MAKE A BOT TO REALIZE HUMAN EMOTIONS Ardhendu Samajdwer Luc Bors ... Luc Bors •Partner & Technical Director @eProseed

Copyright © 2015, eProseed and/or its affiliates. All rights reserved. |

DEMO !

32

Page 33: HOW CAN WE MAKE A BOT TO REALIZE - cdn.ymaws.com · HOW CAN WE MAKE A BOT TO REALIZE HUMAN EMOTIONS Ardhendu Samajdwer Luc Bors ... Luc Bors •Partner & Technical Director @eProseed

Copyright © 2015, eProseed and/or its affiliates. All rights reserved. |

AGENDA

Significance of sentiment analysis

Concepts

Approach

Aftermath

Conclusion

1

2

33

3

4

5

Page 34: HOW CAN WE MAKE A BOT TO REALIZE - cdn.ymaws.com · HOW CAN WE MAKE A BOT TO REALIZE HUMAN EMOTIONS Ardhendu Samajdwer Luc Bors ... Luc Bors •Partner & Technical Director @eProseed

Copyright © 2015, eProseed and/or its affiliates. All rights reserved. |

AFTERMATH

• An Oracle Digital Assistant which can understand and respond to human sentiment.• Your Digital Assistant can react to curse words as trained.• Digital Assistant reacts more like a human and less like a robot.

34

Page 35: HOW CAN WE MAKE A BOT TO REALIZE - cdn.ymaws.com · HOW CAN WE MAKE A BOT TO REALIZE HUMAN EMOTIONS Ardhendu Samajdwer Luc Bors ... Luc Bors •Partner & Technical Director @eProseed

Copyright © 2015, eProseed and/or its affiliates. All rights reserved. |

AGENDA

Significance of sentiment analysis

Concepts

Approach

Aftermath

Conclusion

1

2

35

3

4

5

Page 36: HOW CAN WE MAKE A BOT TO REALIZE - cdn.ymaws.com · HOW CAN WE MAKE A BOT TO REALIZE HUMAN EMOTIONS Ardhendu Samajdwer Luc Bors ... Luc Bors •Partner & Technical Director @eProseed

Copyright © 2015, eProseed and/or its affiliates. All rights reserved. |

CONCLUSION

• Sentiment analysis should be included during Digital Assistant design.• Superior user experience while using Digital Assistant.• Digital Assistant will be less prone to end-up in an unhandled state.• Sentiment analysis may or may not be able to handle extreme human

behavior and needs to be dealt appropriately.

36

Page 37: HOW CAN WE MAKE A BOT TO REALIZE - cdn.ymaws.com · HOW CAN WE MAKE A BOT TO REALIZE HUMAN EMOTIONS Ardhendu Samajdwer Luc Bors ... Luc Bors •Partner & Technical Director @eProseed

Copyright © 2015, eProseed and/or its affiliates. All rights reserved. |

RESOURCES

• Oracle Intelligent Bots Backend Integration with Oracle Mobile Cloud: https://blogs.oracle.com/mobile/techexchange%3a-master-oracle-intelligent-bots-backend-integration-with-oracle-mobile-cloud-enterprise-like-a-pro

• Oracle Digital Assistant - Get Started: https://docs.oracle.com/en/cloud/paas/autonomous-digital-assistant-cloud/index.html

• Building Custom Component Services for Oracle Digital Assistant: https://blogs.oracle.com/mobile/techexchange-tutorial%3a-building-custom-component-services-for-oracle-digital-assistant-in-under-5-minutes-with-oracle-bots-nodejs-sdk

• How-to Debug Custom Component Services Deployed to Oracle Digital Assistant Skill Bot Local Component Container: https://blogs.oracle.com/mobile/techexchange-tutorial%3a-how-to-debug-custom-component-services-deployed-to-oracle-digital-assistant-skill-bot-local-component-container#_ftn1

• Sentiment detection in Oracle Intelligent Bot, Quickly and Easily: https://blogs.oracle.com/mobile/techexchange%3a-sentiment-detection-in-oracle-intelligent-bot%2c-quickly-and-easily

37

Page 38: HOW CAN WE MAKE A BOT TO REALIZE - cdn.ymaws.com · HOW CAN WE MAKE A BOT TO REALIZE HUMAN EMOTIONS Ardhendu Samajdwer Luc Bors ... Luc Bors •Partner & Technical Director @eProseed