iT邦幫忙

2018 iT 邦幫忙鐵人賽
DAY 21
0
AI & Machine Learning

利用 MS Bot framework 與 Cognitive Service 建構自用智慧小秘書系列 第 21

21.Cognitive Service - Bing 影像搜尋服務

前言

搜尋服務了提供人物、地點或圖片等相關資訊搜尋功能,讓你的機器人具有更完善的服務人工智慧,是現代聊天機器人不可或缺的功能之一。 這一篇我們將介紹 Bing 搜尋功能之一 : 影像搜尋服務,其使用方法相較於圖片文字辨識功能來說更簡單。話不多說,趕緊來看看如何使用。


使用 Bing 影像搜尋服務

Step 1. 開啟 Azure Portal → 新增 → 輸入Bing Search → 選擇 Bing Search V7 API
https://d2mxuefqeaa7sj.cloudfront.net/s_80F667717AD6D213A79A0636E4744607463EA709430EDF33FB9F89F347FCCA89_1514173150695_image.png

Step 2. 點選建立
https://d2mxuefqeaa7sj.cloudfront.net/s_80F667717AD6D213A79A0636E4744607463EA709430EDF33FB9F89F347FCCA89_1514173257855_image.png

Step 3. 輸入相關資訊,點選建立

註:Bing Search 服務沒有免費層,使用時會產生額外費用
https://d2mxuefqeaa7sj.cloudfront.net/s_80F667717AD6D213A79A0636E4744607463EA709430EDF33FB9F89F347FCCA89_1514173373995_image.png

Step 4. 建立完成後,一樣很貼心地列出步驟與相關文件連結,我們先點選 Keys
https://d2mxuefqeaa7sj.cloudfront.net/s_80F667717AD6D213A79A0636E4744607463EA709430EDF33FB9F89F347FCCA89_1514173495850_image.png

Step 5. 紀錄其中一把 Key 資料,我們測試與撰寫程式的時候會用到
https://d2mxuefqeaa7sj.cloudfront.net/s_80F667717AD6D213A79A0636E4744607463EA709430EDF33FB9F89F347FCCA89_1514173545297_image.png

Step 6. 我們能在 https://docs.microsoft.com/zh-hk/azure/cognitive-services/bing-image-search/quickstarts/csharp 找到 C#的範例;而在https://docs.microsoft.com/zh-hk/rest/api/cognitiveservices/bing-images-api-v7-reference 可以找到API 詳細說明
https://d2mxuefqeaa7sj.cloudfront.net/s_80F667717AD6D213A79A0636E4744607463EA709430EDF33FB9F89F347FCCA89_1514173727233_image.png


測試

Step 1. 透過文件與範例,我們彙整相關資訊,並且使用postman 進行測試

Method GET
URL https://api.cognitive.microsoft.com/bing/v7.0/images/search
Paramter q=雪納瑞
Ocp-Apim-Subscription-Key (Header) your_key

Step 2. 回傳相當多的雪納瑞圖片資料,成功!
https://d2mxuefqeaa7sj.cloudfront.net/s_80F667717AD6D213A79A0636E4744607463EA709430EDF33FB9F89F347FCCA89_1514175730219_image.png


上一篇
20.應用:自用拼字文法檢查機器人
下一篇
22.應用:自用圖片搜尋機器人
系列文
利用 MS Bot framework 與 Cognitive Service 建構自用智慧小秘書31
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言