SlideShare une entreprise Scribd logo
1  sur  58
Learn from the Expert
利用Luis打造FB聊天機器人
Johnson Gau
高榮章 2017.7
關於我
部落格:(松露筆管麵) http://trufflepenne.blogspot.tw
Microsoft
MVP
Agenda
聊天機器人趨勢
LUIS 介紹
Bot Webapi
FB Bot
Iot 和 AI 的融合 - 魔鏡
Sample code : https://github.com/johnsonkao/UVbot
聊天機器人趨勢
mid-80s
PC
mid-90s
Web
mid-00s
Smartphone
mid-10s
Messaging
The world and technology are once again transforming
– Satya Nadella, CEO Microsoft
UI的演進
交談式UI成為新的平台
聊天機器人是甚麼
什麼是 Chatbot?他是種服務,透過 AI(人工智慧)或自行
定義的自動化規則,讓使用者可以透過聊天通訊的介面,與
其進行互動。如美國的 Carbros,就是一個能回答使用者購
車相關訊息的自動化購車服務。
查詢紫外線
宜蘭地點
宜蘭紫外線指數為 0.5
APP
宜蘭紫外線
指數為 0.5
宜蘭紫外
線多少
我
B
Chatbot
聊天機器人如何運作
理解
動機
提供回應
聊天機器人可提供哪些功能
• 理解動機
• 身分識別
• 歷史資料串接
• 地理資料解析
• 資料查詢
• 機器學習
聊天機器人的組成
AI人工智慧/ML機器學習
大量資料加上雲端運算和人工智慧、機
器學習,讓聊天機器人更像人類。
NLP自然語言處理
隨著演算法的快速進步、自然語言學也
跟著認知更好,越來越能理解人類的話。
通訊軟體
FB Messanger、WeChat、Line、Skype、
Teams紛紛支援Chat bot。
如何設計你的Bot
資料整合是全通路使用者體驗的致勝之道
用戶原本擁有的資訊 用戶的即時資訊
內外部系統整合 即時資訊
CRM、KM、銷售資料、
貨運資料、歷史資料
時區、地理座標、使用者
登入
開始規劃我們的Bot
通訊軟體
FB Messanger
Bot api
Bot framework
語意分析
Luis
你的服務
紫外線
LUIS 介紹
AI應用
• Wit.ai
• API.AI
• Microsoft Cognitive
service
AI Tools Smart HomeService
Edge
computing
Microsoft Cognitive service
Luis 語意分析
Luis.ai網站 https://www.luis.ai
LUIS設計流程
建立APP Entity Intent
輸入語
句訓練
Publish
Intent & Entity
Intent
• 意圖
• 功能
Entity
• 關鍵字
• 變數
意圖 Intent
• 買機票
Entity 關鍵字
• Entity:Quntity, Location(From/To)
我想買[兩張][東京][來回]機票
語意分析的訓練
意圖 Intent
• 問紫外線指數
Entity 關鍵字
• Location > 宜蘭
告訴我[宜蘭]紫外線指數
[宜蘭]紫外線指數如何
[宜蘭]紫外線
建立APP
產生APP ID
建立Entity
Entity Type
Type 說明 用途
Simple 單一的關鍵字 一般用途
List 同義字的集合 主類別—子類別
水果:鳳梨 香蕉 蘋果
Hierarchical 有子關鍵字的應用 機票起訖地點
Location
--FromLocation
--ToLocation
https://docs.microsoft.com/zh-tw/azure/cognitive-services/luis/luis-concept-entity-types
Entity Type
Type 說明 用途
Composite 一個Composite由其他Entity
組成
最多包含20Entity
像是語句
“幫我找2016年紅色Ford Mondeo和2008年白色Audi A4”
Car
--Color
--車廠
--型號
Prebuild dates, times, 和 geograph
List Entity
建立Intent
輸入Utterances
Training & Publish
Bot webapi
Bot webapi設計流程
下載範本
建立Bot
專案
撰寫Luis
對話
上傳
Azure
註冊Bot
FW網站
1. 下載Bot Template
• 下載template LINK
• 儲存 zip 檔並解壓縮放到Visual Studio 2015 templates 目錄
"%USERPROFILE%DocumentsVisual Studio
2015TemplatesProjectTemplatesVisual C#"
2. 建立一個Bot專案
• Visual C# – Bot
Application
• 專案右鍵-重新建置
就會根據 Package.config把參考
的套件下載 。
3. 撰寫Luis對話
• Copy UV.cs , OpenData.cs
• 新增UVDialog.cs
• 繼承LuisDialog<Ob ject >
• 設定[LuisModel…] 的key
• Intent撰寫
• MessagesController.cs
• Post 的RootDialoge改為UVDialog
• message.Type == ActivityTypes.ConversationUpdate 加入歡迎詞
• WebConfig把MicrosoftAppId/ MicrosoftAppPassword輸入
下載Bot Framework Emulator
https://emulator.botframework.com/
Bot Framework Emulator測試
4. 發行到Azure web site
成功後
5.註冊你的Bot
1. 登入到Bot Framework portal
https://dev.botframework.com/
2. Create a bot
5.註冊你的Bot-cont
Profile
Configuration
先貼上https://your_bots_hostname/api/messages
把your_bots_hostname換成你在azue webs site的網址,
key對照
1. LUIS App id
2. LUIS End point key
Bot framework key對照
1. Microsoft App id
2. Microsoft AppPassword
1
2
Bot Framework 範例
https://github.com/Microsoft/BotBuilder-Samples
FB Bot
連接FB Bot 流程
註冊FB Developer
建立個人粉
絲頁
FB APP新增
Messnger應
用程式
設定Bot FW
的APP
設定FB APP
1. 註冊FB Developer
https://developers.facebook.com/
2. 建立個人粉絲頁
3. FB 新增Messenger應用程式
• 新增應用程式
• 新增產品-Messenger
• 產生權杖,最後會用到,先記住
4. 設定Bot FW的APP
Add a channel
• 設定下四個欄位
打開FB開發者頁面---主控版,作資料查詢
A. Facebook Page ID:粉絲專頁編號
B. FB APP ID :以下
C. Facebook App Secret:應用程式密鑰:以下
D:Page Access Token: FB 粉絲專頁存取權杖
5. 設定Bot FW的APP
回到FB webhook
• 成功後最後要記得訂閱自己的粉絲頁
測試
魔鏡
架構
Bot Web API
Open
Data
Topic
Message
Hub
魔鏡
Bot Framework
Channel
Web
IOPI
Weath
er API
MQTT
PushSubscribe
LUIS.AI 語意分析
人臉辨識
Mail
Sigfox
Unashield Sigfox web
人臉辨識
影片
利用 Luis打造fb聊天機器人

Contenu connexe

Similaire à 利用 Luis打造fb聊天機器人

[COSCUP 2022]看圖說故事AI機器人
[COSCUP 2022]看圖說故事AI機器人[COSCUP 2022]看圖說故事AI機器人
[COSCUP 2022]看圖說故事AI機器人佳新 陳
 
Tj bot 0317實作坊 組裝篇
Tj bot 0317實作坊 組裝篇Tj bot 0317實作坊 組裝篇
Tj bot 0317實作坊 組裝篇湯米吳 Tommy Wu
 
《氪周刊:互联网创业必读》(第83期)
《氪周刊:互联网创业必读》(第83期)《氪周刊:互联网创业必读》(第83期)
《氪周刊:互联网创业必读》(第83期)36Kr.com
 
入門 Teams Bot
入門 Teams Bot入門 Teams Bot
入門 Teams BotKo Ko
 
SignalR整合LINE,在LIFF裡建立一對一聊天管道
SignalR整合LINE,在LIFF裡建立一對一聊天管道SignalR整合LINE,在LIFF裡建立一對一聊天管道
SignalR整合LINE,在LIFF裡建立一對一聊天管道Ko Ko
 
微軟技術暨生態大會 - AI304 - 讓人工智慧為企業所用
微軟技術暨生態大會 - AI304 - 讓人工智慧為企業所用微軟技術暨生態大會 - AI304 - 讓人工智慧為企業所用
微軟技術暨生態大會 - AI304 - 讓人工智慧為企業所用Michael Chi
 
活用Flex彈性訊息,讓你的LINE聊天機器人更親民、更出色!
活用Flex彈性訊息,讓你的LINE聊天機器人更親民、更出色!活用Flex彈性訊息,讓你的LINE聊天機器人更親民、更出色!
活用Flex彈性訊息,讓你的LINE聊天機器人更親民、更出色!佳新 陳
 
《氪周刊:互联网创业必读》(第65期)
《氪周刊:互联网创业必读》(第65期)《氪周刊:互联网创业必读》(第65期)
《氪周刊:互联网创业必读》(第65期)chenzhongren
 
《氪周刊:互联网创业必读》(第65期)
《氪周刊:互联网创业必读》(第65期)《氪周刊:互联网创业必读》(第65期)
《氪周刊:互联网创业必读》(第65期)Chada Chiu
 
OpenAI ChatGPT techtalk .pptx
OpenAI ChatGPT techtalk .pptxOpenAI ChatGPT techtalk .pptx
OpenAI ChatGPT techtalk .pptxSimmy41
 
ChatGPT 研究框架(2023).pdf
ChatGPT 研究框架(2023).pdfChatGPT 研究框架(2023).pdf
ChatGPT 研究框架(2023).pdf灿辉 葛
 
IxDC 中国交互设计体验日-大会_黄峰_体验设计,我们要走的更远
IxDC 中国交互设计体验日-大会_黄峰_体验设计,我们要走的更远IxDC 中国交互设计体验日-大会_黄峰_体验设计,我们要走的更远
IxDC 中国交互设计体验日-大会_黄峰_体验设计,我们要走的更远IxDC
 
Carat media news_letter-888r
Carat media news_letter-888rCarat media news_letter-888r
Carat media news_letter-888rCaratR
 
Azure Cognitive Services - TTS 文字轉語音小幫手機器人
Azure Cognitive Services - TTS 文字轉語音小幫手機器人Azure Cognitive Services - TTS 文字轉語音小幫手機器人
Azure Cognitive Services - TTS 文字轉語音小幫手機器人佳新 陳
 
1130用dialogflow建立聊天機器人.pdf
1130用dialogflow建立聊天機器人.pdf1130用dialogflow建立聊天機器人.pdf
1130用dialogflow建立聊天機器人.pdfssuserded2d4
 
1130用dialogflow建立聊天機器人.pdf
1130用dialogflow建立聊天機器人.pdf1130用dialogflow建立聊天機器人.pdf
1130用dialogflow建立聊天機器人.pdfssuserded2d4
 
Startuper周刊:第一期(10.1~10.7)
Startuper周刊:第一期(10.1~10.7)Startuper周刊:第一期(10.1~10.7)
Startuper周刊:第一期(10.1~10.7)starjake
 
LINE@ 2.0 offline to online
LINE@ 2.0  offline to onlineLINE@ 2.0  offline to online
LINE@ 2.0 offline to onlineCaesar Chi
 
《氪周刊:互联网创业必读》(第80期)
《氪周刊:互联网创业必读》(第80期)《氪周刊:互联网创业必读》(第80期)
《氪周刊:互联网创业必读》(第80期)36Kr.com
 

Similaire à 利用 Luis打造fb聊天機器人 (20)

[COSCUP 2022]看圖說故事AI機器人
[COSCUP 2022]看圖說故事AI機器人[COSCUP 2022]看圖說故事AI機器人
[COSCUP 2022]看圖說故事AI機器人
 
Tj bot 0317實作坊 組裝篇
Tj bot 0317實作坊 組裝篇Tj bot 0317實作坊 組裝篇
Tj bot 0317實作坊 組裝篇
 
《氪周刊:互联网创业必读》(第83期)
《氪周刊:互联网创业必读》(第83期)《氪周刊:互联网创业必读》(第83期)
《氪周刊:互联网创业必读》(第83期)
 
入門 Teams Bot
入門 Teams Bot入門 Teams Bot
入門 Teams Bot
 
SignalR整合LINE,在LIFF裡建立一對一聊天管道
SignalR整合LINE,在LIFF裡建立一對一聊天管道SignalR整合LINE,在LIFF裡建立一對一聊天管道
SignalR整合LINE,在LIFF裡建立一對一聊天管道
 
微軟技術暨生態大會 - AI304 - 讓人工智慧為企業所用
微軟技術暨生態大會 - AI304 - 讓人工智慧為企業所用微軟技術暨生態大會 - AI304 - 讓人工智慧為企業所用
微軟技術暨生態大會 - AI304 - 讓人工智慧為企業所用
 
活用Flex彈性訊息,讓你的LINE聊天機器人更親民、更出色!
活用Flex彈性訊息,讓你的LINE聊天機器人更親民、更出色!活用Flex彈性訊息,讓你的LINE聊天機器人更親民、更出色!
活用Flex彈性訊息,讓你的LINE聊天機器人更親民、更出色!
 
《氪周刊:互联网创业必读》(第65期)
《氪周刊:互联网创业必读》(第65期)《氪周刊:互联网创业必读》(第65期)
《氪周刊:互联网创业必读》(第65期)
 
《氪周刊:互联网创业必读》(第65期)
《氪周刊:互联网创业必读》(第65期)《氪周刊:互联网创业必读》(第65期)
《氪周刊:互联网创业必读》(第65期)
 
OpenAI ChatGPT techtalk .pptx
OpenAI ChatGPT techtalk .pptxOpenAI ChatGPT techtalk .pptx
OpenAI ChatGPT techtalk .pptx
 
ChatGPT 研究框架(2023).pdf
ChatGPT 研究框架(2023).pdfChatGPT 研究框架(2023).pdf
ChatGPT 研究框架(2023).pdf
 
IxDC 中国交互设计体验日-大会_黄峰_体验设计,我们要走的更远
IxDC 中国交互设计体验日-大会_黄峰_体验设计,我们要走的更远IxDC 中国交互设计体验日-大会_黄峰_体验设计,我们要走的更远
IxDC 中国交互设计体验日-大会_黄峰_体验设计,我们要走的更远
 
Carat media news_letter-888r
Carat media news_letter-888rCarat media news_letter-888r
Carat media news_letter-888r
 
Azure Cognitive Services - TTS 文字轉語音小幫手機器人
Azure Cognitive Services - TTS 文字轉語音小幫手機器人Azure Cognitive Services - TTS 文字轉語音小幫手機器人
Azure Cognitive Services - TTS 文字轉語音小幫手機器人
 
1130用dialogflow建立聊天機器人.pdf
1130用dialogflow建立聊天機器人.pdf1130用dialogflow建立聊天機器人.pdf
1130用dialogflow建立聊天機器人.pdf
 
1130用dialogflow建立聊天機器人.pdf
1130用dialogflow建立聊天機器人.pdf1130用dialogflow建立聊天機器人.pdf
1130用dialogflow建立聊天機器人.pdf
 
Startuper周刊:第一期(10.1~10.7)
Startuper周刊:第一期(10.1~10.7)Startuper周刊:第一期(10.1~10.7)
Startuper周刊:第一期(10.1~10.7)
 
LINE@ 2.0 offline to online
LINE@ 2.0  offline to onlineLINE@ 2.0  offline to online
LINE@ 2.0 offline to online
 
《氪周刊:互联网创业必读》(第80期)
《氪周刊:互联网创业必读》(第80期)《氪周刊:互联网创业必读》(第80期)
《氪周刊:互联网创业必读》(第80期)
 
周刊第三期
周刊第三期周刊第三期
周刊第三期
 

利用 Luis打造fb聊天機器人

Notes de l'éditeur

  1. 來參加課程的動機: 公司的Bot/比賽/單純想了解bot
  2. “The world and technology are once again transforming” – Satya Nadella, CEO Microsoft Use of Messaging apps surpassed Social apps in 2015 We want to take that power of human language and apply it more pervasively to all of the computing interface and the computing interactions through machine learning and AI. CAAP: Having the most natural enriched conversation with anyone -> Skype Translator (and other cognitive services) Apply the same power of human conversation to everything else -> a personal digital assistant that know you and your world, and is always there to help you with your everyday tasks across all devices Calling any application (as a bot) within a conversational canvas instead of looking at pages and pages of websites and apps “And so you can conceptualize this platform where human language is the new UI layer. Bots are like new applications, and digital assistants are meta apps or like the new browsers. And intelligence is infused into all of your interactions. That’s the rich platform that we have.” Articles: https://chatbotbook.com/the-rise-of-intelligent-bots-e896cde7281b#.3xv2h6m48 https://chatbotsmagazine.com/chinas-wechat-foretells-facebook-microsoft-bot-platforms-future-278c3bd4bf14#.7jtideqdl http://www.cnet.com/how-to/what-is-a-bot/#! http://www.theverge.com/2016/3/30/11334000/microsoft-big-bots-bet http://www.enterprise-security-today.com/news/Why-Should-We-Care-About-Bots-/story.xhtml?story_id=0110018ENHC3 http://www.marketplace.org/2016/04/11/tech/chat-bots
  3. Domain Driven Design (DDD) is an object-oriented approach to designing software based on the business domain, its elements and behaviors, and the relationships between them
  4. Domain Driven Design (DDD) is an object-oriented approach to designing software based on the business domain, its elements and behaviors, and the relationships between them
  5. Domain Driven Design (DDD) is an object-oriented approach to designing software based on the business domain, its elements and behaviors, and the relationships between them
  6. Domain Driven Design (DDD) is an object-oriented approach to designing software based on the business domain, its elements and behaviors, and the relationships between them
  7. Domain Driven Design (DDD) is an object-oriented approach to designing software based on the business domain, its elements and behaviors, and the relationships between them
  8. A number of design patterns support the layered architectural style. For example, Separated Presentation
  9. A number of design patterns support the layered architectural style. For example, Separated Presentation