Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Cognitive Service

Sponsored · SiteGround - Reliable hosting with speed, security, and support you can count on.

Cognitive Service

Avatar for Ryan Chung

Ryan Chung

May 29, 2020
Tweet

More Decks by Ryan Chung

Other Decks in Technology

Transcript

  1. 辨識服務 MS Cognitive Service • 可聰明地識別、標示及 控管圖片的影像處理演算法。 • 對應複雜資訊和資料,以解決 智慧建議和語意搜尋等工作。

    • 讓您的應用程式能夠透過預先建置的指令碼處理自然語言、 評估情感,以及瞭解 如何辨識使用者想要的項目。 • 將語音轉換成文字、使用語音來驗證,或將說話者 辨識新增至您的應用程式。 • 將 Bing 搜尋 API 新增至您的應用程式,並充分利用 以單一 API 呼叫合併數十億個 網頁、影像、影片和新聞的能力。
  2. 辨識服務 MS Cognitive Service • 電腦影像 – 分析圖像中的內容 • 圖像概觀

    – 不同語言顯示 • 圖像中的文字 – 信用卡卡號辨識 • 文本翻譯 -檢測並翻譯 60 多種支援的語言 • 語句翻譯 – 嘗試不同語言輸入輸出
  3. 延伸練習:改成可以使用本地檔案上傳 Image to analyze: <input type="file" name="inputImage" id="inputImage" data-target="file- uploader"

    accept="image/*" /> <!--<button onclick="processImage()">分析圖片</button>--> $("document").ready(function(){ $("#inputImage").change(function(e){ processImage(e.target.files[0]); }); }); function processImage(imageObject) {
  4. 延伸練習:改成可以使用本地檔案上傳 //顯示分析的圖片 var sourceImageUrl = URL.createObjectURL(imageObject); document.querySelector("#sourceImage").src = sourceImageUrl; //送出分析

    $.ajax({ url: uriBase + "?" + $.param(params), // Request header beforeSend: function(xhrObj){ xhrObj.setRequestHeader("Content-Type","application/octet-stream"); xhrObj.setRequestHeader("Ocp-Apim-Subscription-Key", subscriptionKey); }, type: "POST", processData:false, contentType:false, // Request body data: imageObject, })
  5. 影像文字內識別:信用卡號碼辨識 let endpoint = "https://westcentralus.api.cognitive.microsoft.com/"; if (!subscriptionKey) { throw new

    Error('Set your environment variables for your subscrip tion key and endpoint.'); } var uriBase = endpoint + "vision/v2.1/read/core/asyncBatchAnalyze"; .done(function(data) { // Show formatted JSON on webpage. $("#responseTextArea").val(JSON.stringify(data, null, 2)); let recognitionArray = data.recognitionResults[0].lines; for(let x=0; x<recognitionArray.length;x++){ if(recognitionArray[x].text.length==19){ $("#RecognitionCardNumber").text(recognitionArray[x].text); } } })
  6. 辨識服務 MS Cognitive Service • 電腦影像 – 分析圖像中的內容 • 圖像概觀

    – 不同語言顯示 • 圖像中的文字 – 信用卡卡號辨識 • 文本翻譯 -檢測並翻譯 60 多種支援的語言 • 語句翻譯 – 嘗試不同語言輸入輸出