iT邦幫忙

2021 iThome 鐵人賽

DAY 29
0
AI & Data

AI ninja project系列 第 29

AI ninja project [day 29] Dialogflow--聊天客服機器人

這篇介紹的為Dialogflow ES版本,
可以搜尋Dialogflow ES documentation 來查看基礎版的文件。
如果想查看企業 CX版本,
可以搜尋Dialogflow CX documentation。

首先第一步,
當你註冊申請完成來到了Dialogflow,可以看到主畫面:
https://ithelp.ithome.com.tw/upload/images/20210928/201226781fehAVGZB7.png

我們可以點選左上角create new agent來創建新的機器人:
https://ithelp.ithome.com.tw/upload/images/20210928/20122678il2krKoSAy.png

https://ithelp.ithome.com.tw/upload/images/20210928/201226789u6sqc4xvn.png

  • 區塊1: 點擊可以修改機器人名稱。
  • 區塊2: 修改預設溝通語言
  • 區塊3: 時區選擇
  • 區塊4: 是否串接gcp cloud function功能
  • 區塊5: 是否有納入其他已經設定好機器人的功能

假設有開啟區塊5的功能,
可以設定將哪個機器人納入:
https://ithelp.ithome.com.tw/upload/images/20210928/201226782Vn3qVY0Tw.png

接著,我們可以設定意圖(Intents),
可能是使用者對話時想要詢問的問題或交流的內容:
https://ithelp.ithome.com.tw/upload/images/20210928/2012267838ppPEzRBl.png

可以修改意圖(Intents)的標籤命名,
在Training phrases 打上使用者可能會進行的對話:
https://ithelp.ithome.com.tw/upload/images/20210928/20122678MXjQtxteus.png

在Responses的區塊打上回答,有多個回答會以機率來選出答案:
https://ithelp.ithome.com.tw/upload/images/20210928/20122678g1H5o0nYM4.png
編輯完記得右上角按儲存。

再來是實體(Entities)的設定,可以自訂實體:
https://ithelp.ithome.com.tw/upload/images/20210928/20122678l7lrWhw4rQ.png

可以設定實體的同義字,幫助機器人對於意圖(Intents)的了解以及回答:
https://ithelp.ithome.com.tw/upload/images/20210928/20122678vU0oTUPryK.png

在Training phrases的字詞按右鍵來標記實體,
在這裡我們設定了溫度為系統預設的實體(Entities) @sys.temperature:
https://ithelp.ithome.com.tw/upload/images/20210928/20122678xs5WRgRCAy.png

系統設定的實體(Entities)類別可以發現多了一類:
https://ithelp.ithome.com.tw/upload/images/20210928/201226781aQJ1HUO3s.png

右上角我們可以用打字或麥克風跟機器人對話,
我們打了沙丘,
但是機器人聽不懂。
我們可以從歷史紀錄來查看是否有未捕捉到的意圖,
未來可以新增意圖及回答:
https://ithelp.ithome.com.tw/upload/images/20210928/20122678JtyT4s57GT.png

新增意圖及回答之後:
https://ithelp.ithome.com.tw/upload/images/20210928/20122678JiiReC3JU8.png

再來點選Integrations之後,我們可以看看有那些可以把機器人做整合的選項:
https://ithelp.ithome.com.tw/upload/images/20210928/20122678mUI2Tqm8uW.png

可以發現可以整合進網頁、Line聊天機器人、Facebook Messenger:
https://ithelp.ithome.com.tw/upload/images/20210928/201226785p2icBchRn.png

點選Web Demo,
可以在自己寫的網頁(HTML)貼上iframe的程式區塊:
https://ithelp.ithome.com.tw/upload/images/20210928/20122678ZGayGHknrW.png

點選測試連結來測試:
https://ithelp.ithome.com.tw/upload/images/20210928/20122678hC4YiSkFwR.png

串接Line聊天機器人的部分,
可以從line開發者頁面獲取Channel ID、Channel Secret、Channel Access Token,
最後設定webhook url進行串接:
https://ithelp.ithome.com.tw/upload/images/20210928/20122678CENQzV9n8N.png

可以參考: Line Messaging API

而Facebook Messenger的串接方法參考影片:
Yes


上一篇
AI ninja project [day 28] QLattice --進階迴歸
下一篇
AI ninja project [day 30] 結語
系列文
AI ninja project30
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言