39
Human Vs Bot Sasso Carta Forbice Matteo Valoriani Antimo Musone MILAN 25-26 NOVEMBER 2016

Human vs Bot: Giocare a Sasso-Carta-Forbici - Matteo Valoriani, Antimo Musone - Codemotion Milan 2016

Embed Size (px)

Citation preview

Page 1: Human vs Bot: Giocare a Sasso-Carta-Forbici - Matteo Valoriani, Antimo Musone - Codemotion Milan 2016

Human Vs Bot Sasso Carta Forbice

Matteo ValorianiAntimo Musone

MILAN 25-26 NOVEMBER 2016

Page 2: Human vs Bot: Giocare a Sasso-Carta-Forbici - Matteo Valoriani, Antimo Musone - Codemotion Milan 2016

About USMatteo Valoriani Co-Founder Fifth Ingenum Srls. Community .Net Lombardia Teaching Assistant Politecnico Milano Email:[email protected]

Antimo Musone Co-Founder Fifth Ingenum Srls. IT Manager / Architect for EY - Italy Ing. Informatica II Università di Napoli Email:[email protected]

Page 3: Human vs Bot: Giocare a Sasso-Carta-Forbici - Matteo Valoriani, Antimo Musone - Codemotion Milan 2016

Target : Rock-Paper-Scissors Bot Game

Routes messagesManage stateBot Directory

Session trackingAPI / SDK

Channels

Prediction algorithms

Game Logic

Bot ConnectorBot

Prediction algorithms

Prediction algorithms

Web Services

Microsoft Azure Bot

Microsoft Bot Framework

Microsoft Azure Function

Azure Machine Learning

Azure Machine Learning

Azure Machine Learning

Page 4: Human vs Bot: Giocare a Sasso-Carta-Forbici - Matteo Valoriani, Antimo Musone - Codemotion Milan 2016

http://codemotionwebbot.azurewebsites.net/

Page 5: Human vs Bot: Giocare a Sasso-Carta-Forbici - Matteo Valoriani, Antimo Musone - Codemotion Milan 2016

Intro to Bot Framework & Cognitive Services

Page 6: Human vs Bot: Giocare a Sasso-Carta-Forbici - Matteo Valoriani, Antimo Musone - Codemotion Milan 2016

MS Bot Frameworkhttps://dev.botframework.com

A bot is a web service that interacts with users in a conversational format.Start conversations with your bot from any channel that you’ve configured your bot to work on Text/SMS, Skype, Slack, Facebook Messenger, and other popular services.

Page 7: Human vs Bot: Giocare a Sasso-Carta-Forbici - Matteo Valoriani, Antimo Musone - Codemotion Milan 2016

Overview MS Bot Framework

http://docs.botframework.com

Components:• Connect

or • Builder

SDK• Develop

er Portal• Bot

Directory

Page 8: Human vs Bot: Giocare a Sasso-Carta-Forbici - Matteo Valoriani, Antimo Musone - Codemotion Milan 2016

Bot ConnectorChannels:• Facebook• Email• GroupMe• Skype• Slack• SMS• Telegram• Web• etc...

http://docs.botframework.com/connector/getstarted

Page 9: Human vs Bot: Giocare a Sasso-Carta-Forbici - Matteo Valoriani, Antimo Musone - Codemotion Milan 2016

Configure: Web Chat https://webchat.botframework.com/Dev/?botId=YOUR-BOT-ID

Page 10: Human vs Bot: Giocare a Sasso-Carta-Forbici - Matteo Valoriani, Antimo Musone - Codemotion Milan 2016

Configure: Facebook Messenger

https://facebook.botframework.com/Dev/?botId=YOUR-BOT-ID

Page 11: Human vs Bot: Giocare a Sasso-Carta-Forbici - Matteo Valoriani, Antimo Musone - Codemotion Milan 2016

FB Developer Settingshttps://developers.facebook.com

Page 12: Human vs Bot: Giocare a Sasso-Carta-Forbici - Matteo Valoriani, Antimo Musone - Codemotion Milan 2016

Configure: Direct Linehttps://directline.botframework.com/Dev/?botId=YOUR-BOT-ID

Page 13: Human vs Bot: Giocare a Sasso-Carta-Forbici - Matteo Valoriani, Antimo Musone - Codemotion Milan 2016

Bot Builder SDK for C#Features:• Dialogs• AI• LUIS• Stateless• Scalable• FormFlow• GitHub!

http://docs.botframework.com/sdkreference/csharp

To build your bot, the Framework provides a .NET SDK and Node.js SDK. SDKs provide features such as dialogs and built-in prompts that make interacting with usersThe Bot Builder SDK is provided as open source on GitHub ( BotBuilder)

Page 14: Human vs Bot: Giocare a Sasso-Carta-Forbici - Matteo Valoriani, Antimo Musone - Codemotion Milan 2016

Core Conceptshttp://docs.botframework.com/sdkreference/csharp

AuthenticationThe Bot Connector service uses OAuth 2.0 client credentials for bot authentication.ConversationThe Bot can have a private conversation with a single user, or a group conversation with multiple users including other bots. (not all channels support group conversations)MessagesA conversation is a series of message, each message is an Activity object. When a user sends a message, the channel that they’re communicating on posts the message to your bot (web service). Types of messages:• contactRelationUpdate• conversationUpdate• deleteUserData• Message• Ping• typing

Page 15: Human vs Bot: Giocare a Sasso-Carta-Forbici - Matteo Valoriani, Antimo Musone - Codemotion Milan 2016

GitHub!https://github.com/Microsoft/botbuilder

Page 16: Human vs Bot: Giocare a Sasso-Carta-Forbici - Matteo Valoriani, Antimo Musone - Codemotion Milan 2016

Bot Directoryhttps://bots.botframework.com/

Page 17: Human vs Bot: Giocare a Sasso-Carta-Forbici - Matteo Valoriani, Antimo Musone - Codemotion Milan 2016

DemoStart coding

microsoft.com/cognitive

Page 18: Human vs Bot: Giocare a Sasso-Carta-Forbici - Matteo Valoriani, Antimo Musone - Codemotion Milan 2016

Microsoft

Cognitive ServicesGive your apps a human side

VisionFrom faces to feelings, allow your

apps to understand images and videoSpeechHear and speak to your users by filtering noise, identifying speakers, and understanding intentLanguageProcess text and learn how to recognize what users wantKnowledgeTap into rich knowledge amassed from the web, academia, or your own dataSearchAccess billions of web pages, images, videos, and news with the power of Bing APIs

Cognitive Services

Page 19: Human vs Bot: Giocare a Sasso-Carta-Forbici - Matteo Valoriani, Antimo Musone - Codemotion Milan 2016

Cognitive Services

Emotion Speaker Recognition

Speech

Custom Recognition

Computer Vision

Face

Video

microsoft.com/cognitiveSearchSpeech Languag

eKnowledge

Vision

Linguistic AnalysisLanguage Understanding

Bing Spell Check

Entity Linking

Knowledge Exploration

Academic Knowledge

Bing Image SearchBing Video Search

Bing Web Search

WebLM

Text Analytics Recommendations

Bing Autosuggest

Bing News SearchTranslator

Page 20: Human vs Bot: Giocare a Sasso-Carta-Forbici - Matteo Valoriani, Antimo Musone - Codemotion Milan 2016

Cognitive Services

Emotion Speaker Recognition

Speech

Custom Recognition

Computer Vision

Face

Video

SearchSpeech Languag

eKnowledge

Vision

Linguistic AnalysisLanguage Understanding

Bing Spell Check

Entity Linking

Knowledge Exploration

Academic Knowledge

Bing Image SearchBing Video Search

Bing Web Search

WebLM

Text Analytics Recommendations

Bing Autosuggest

Bing News SearchTranslator

microsoft.com/cognitive

Page 21: Human vs Bot: Giocare a Sasso-Carta-Forbici - Matteo Valoriani, Antimo Musone - Codemotion Milan 2016

Language Understanding

Page 22: Human vs Bot: Giocare a Sasso-Carta-Forbici - Matteo Valoriani, Antimo Musone - Codemotion Milan 2016
Page 23: Human vs Bot: Giocare a Sasso-Carta-Forbici - Matteo Valoriani, Antimo Musone - Codemotion Milan 2016

Language Understanding Intelligent Service ( LUIS )

https://www.luis.ai/

Page 24: Human vs Bot: Giocare a Sasso-Carta-Forbici - Matteo Valoriani, Antimo Musone - Codemotion Milan 2016

{“entities”: [

{“entity”:

“flight_delays”,“type”: “Topic”

}],“intents”: [

{“intent”:

“FindNews”,“score”: 0.99853384

},{

“intent”: “None”,“score”: 0.07289317

},{

“intent”: “ReadNews”,

“score”: 0.0167122427

},{

“intent”: “ShareNews”,

“score”: 1.0919299E-06

}]

}

“News about flight delays”

Language Understanding Models

Page 25: Human vs Bot: Giocare a Sasso-Carta-Forbici - Matteo Valoriani, Antimo Musone - Codemotion Milan 2016

Language Understanding ModelsReduce labeling effort with interactive featuringApplication Integration Deploy using just a few examples with active learningSupports 5 languages (English, Chinese, Italian, French, Spanish)Learning Process :

Define Concepts

ProvideExamples Active LearningDeploy

Language Understanding Models

Page 26: Human vs Bot: Giocare a Sasso-Carta-Forbici - Matteo Valoriani, Antimo Musone - Codemotion Milan 2016

Let’s get started!https://www.luis.ai/

Page 27: Human vs Bot: Giocare a Sasso-Carta-Forbici - Matteo Valoriani, Antimo Musone - Codemotion Milan 2016

Adding intents, entities, and labels

Intent:• Name• Utterances• Action

Page 28: Human vs Bot: Giocare a Sasso-Carta-Forbici - Matteo Valoriani, Antimo Musone - Codemotion Milan 2016

Adding intents, entities, and labels

Entity:• Name• Hierarchical• Composite• Labeling

Page 29: Human vs Bot: Giocare a Sasso-Carta-Forbici - Matteo Valoriani, Antimo Musone - Codemotion Milan 2016

Train & Publishing a ModelFinal:• Train• Suggest• Review• Publish

Page 30: Human vs Bot: Giocare a Sasso-Carta-Forbici - Matteo Valoriani, Antimo Musone - Codemotion Milan 2016

DemoStart coding

microsoft.com/cognitive

Page 31: Human vs Bot: Giocare a Sasso-Carta-Forbici - Matteo Valoriani, Antimo Musone - Codemotion Milan 2016

Serverless Architecture -Azure Function

Page 32: Human vs Bot: Giocare a Sasso-Carta-Forbici - Matteo Valoriani, Antimo Musone - Codemotion Milan 2016
Page 33: Human vs Bot: Giocare a Sasso-Carta-Forbici - Matteo Valoriani, Antimo Musone - Codemotion Milan 2016

Mic

roso

ft Az

ure

Func

tion

Page 34: Human vs Bot: Giocare a Sasso-Carta-Forbici - Matteo Valoriani, Antimo Musone - Codemotion Milan 2016

DemoStart coding

microsoft.com/cognitive

Page 35: Human vs Bot: Giocare a Sasso-Carta-Forbici - Matteo Valoriani, Antimo Musone - Codemotion Milan 2016

Azure Machine Learning

Page 36: Human vs Bot: Giocare a Sasso-Carta-Forbici - Matteo Valoriani, Antimo Musone - Codemotion Milan 2016

Azure Machine Learning Studio

Page 37: Human vs Bot: Giocare a Sasso-Carta-Forbici - Matteo Valoriani, Antimo Musone - Codemotion Milan 2016

Machine Learning Studio

Page 38: Human vs Bot: Giocare a Sasso-Carta-Forbici - Matteo Valoriani, Antimo Musone - Codemotion Milan 2016

DemoStart coding

microsoft.com/cognitive

Page 39: Human vs Bot: Giocare a Sasso-Carta-Forbici - Matteo Valoriani, Antimo Musone - Codemotion Milan 2016

Q&A

Matteo ValorianiAntimo Musone