Using Cognitive Service Computer Vision API, Text Analytics API With Azure Logic App

Azure Logic Apps

 Logic App is a cloud-based service. It allows us to react to an event in one service (such as SharePoint online) and do something with the data from that event into another Service (such as Twitter). It makes it practical and simple for business processes. The users build workflows that automatically perform some business tasks and processes across applications and services. We can connect our business-critical apps and services with Azure Logic Apps, automating our workflows without writing a single line of code.

Before reading this article, please go through some important article links, mentioned below.

Here, we will see how to convert OCR File to Text file automatically.

How to create a Logic Flow to convert an OCR File to Text


Here, we need to connect to DropBox, Storage (Blob), Microsoft Cognitive Service (Computer Vision and Text Analytics), and OneDrive.

Prerequisites

  • Microsoft Azure Account
  • DropBox Account
  • OneDrive Account

Follow the below steps to build a workflow using a template.

Step 1

Create Microsoft Cognitive Service – Optical Character Recognition(OCR) to Text.

Log into https://portal.azure.com/

  • On the dashboard, search for "AI + Machine Learning" and click on "Computer Vision".
Using Cognitive Service Computer Vision API, Text Analytics API With Azure Logic App
  • Enter the name, subscription, pricing tier, and resource group for the Computer Vision API. Then, click on "Create".
Using Cognitive Service Computer Vision API, Text Analytics API With Azure Logic App
  • Under Keys, you have keys for accessing the Computer Vision.
Using Cognitive Service Computer Vision API, Text Analytics API With Azure Logic App

Step 2 - Create the Storage Account

  • On the dashboard, select "Create a resource" and click on "Storage". Now, choose Storage account.
Using Cognitive Service Computer Vision API, Text Analytics API With Azure Logic App
  • Enter the name, subscription, location and the Access tier. Then, click on "Create".
Using Cognitive Service Computer Vision API, Text Analytics API With Azure Logic App
  • Create the container.
Using Cognitive Service Computer Vision API, Text Analytics API With Azure Logic App
  • Open up the container and choose properties. There we have a storage URL.
Using Cognitive Service Computer Vision API, Text Analytics API With Azure Logic App

Step 3 - Create a Cognitive Service for Text Analysis

  • In the dashboard, select "Create a resource" and click on "AI + Machine Learning". Now, choose Text Analytics for creating the Cognitive Service.
Using Cognitive Service Computer Vision API, Text Analytics API With Azure Logic App
  • Enter the name (TextACog) you want to assign to the Text Analytics, choose the subscription and resource group where you organize related resources, and location where your logic app stored and the pricing tier. Then, click on "Create".
Using Cognitive Service Computer Vision API, Text Analytics API With Azure Logic App
  • Under the Keys, you have keys for accessing the Text Analytics.
Using Cognitive Service Computer Vision API, Text Analytics API With Azure Logic App

Step 4

Now, let us create the Logic App for converting the OCR File to Text and store it on the OneDrive.

  • In the dashboard, choose to create a resource and click on Integration. Now, choose Logic App.
Using Cognitive Service Computer Vision API, Text Analytics API With Azure Logic App
  • Enter the name you want to assign to the logic, choose the subscription, resource group where you organize related resources, and location where your logic app is stored. Then, click on "Create".
Using Cognitive Service Computer Vision API, Text Analytics API With Azure Logic App
  • Here is the dashboard. Click on Logic App Designer.
Using Cognitive Service Computer Vision API, Text Analytics API With Azure Logic App

Step 3

Now, click on the Blank Logic App.

Using Cognitive Service Computer Vision API, Text Analytics API With Azure Logic App

Step 4

Configure the data by signing into DropBox and Excel Online.

  • Search DropBox on the search bar.
Using Cognitive Service Computer Vision API, Text Analytics API With Azure Logic App
  • Choose the Triggers tab.
Using Cognitive Service Computer Vision API, Text Analytics API With Azure Logic App
  • Next, let us sign in.
Using Cognitive Service Computer Vision API, Text Analytics API With Azure Logic App
  • Give permission to access our accounts.
Using Cognitive Service Computer Vision API, Text Analytics API With Azure Logic App
  • Next, Choose Folder name where you upload the images. And then, give the time interval and frequency for checking the workflow as one minute.
Using Cognitive Service Computer Vision API, Text Analytics API With Azure Logic App

Step 5

Configure the Blob Storage

  • Search Blob Storage
Using Cognitive Service Computer Vision API, Text Analytics API With Azure Logic App
  • Choose the Storage Connection
Using Cognitive Service Computer Vision API, Text Analytics API With Azure Logic App
  • Next, Choose the folder path, Blob name, and Blob content.
Using Cognitive Service Computer Vision API, Text Analytics API With Azure Logic App

Step 6

Configure the computer Vision API for detecting the sentiment of the tweet.

  • Search for Computer Vision.
Using Cognitive Service Computer Vision API, Text Analytics API With Azure Logic App
  • Choose the Action.
Using Cognitive Service Computer Vision API, Text Analytics API With Azure Logic App
  • After that, give the Cognitive Service Connection name and key.
Using Cognitive Service Computer Vision API, Text Analytics API With Azure Logic App
  • Configure the condition.
Using Cognitive Service Computer Vision API, Text Analytics API With Azure Logic App

Step 6

Configure the Text Analytics for detecting the Language.

  • Search for Text Analytics.
Using Cognitive Service Computer Vision API, Text Analytics API With Azure Logic App
  • Then, choose an Action for the workflow.
Using Cognitive Service Computer Vision API, Text Analytics API With Azure Logic App
  • Next, choose the detected text.
Using Cognitive Service Computer Vision API, Text Analytics API With Azure Logic App

Step 7

Configure the Text Analytics for detecting the Key Phrases.

  • Choose an Action for the workflow.
Using Cognitive Service Computer Vision API, Text Analytics API With Azure Logic App
  • Next, choose the detected text
Using Cognitive Service Computer Vision API, Text Analytics API With Azure Logic App

Step 8

Configure the Text Analytics for detecting the sentiment of the tweet.

  • Search for detect sentiment.
Using Cognitive Service Computer Vision API, Text Analytics API With Azure Logic App
  • Choose the Action.
Using Cognitive Service Computer Vision API, Text Analytics API With Azure Logic App
  • Next, choose the detected text
Using Cognitive Service Computer Vision API, Text Analytics API With Azure Logic App

Step 9

  • Next, we want to save that value into the Excel sheet, so search for Excel Online.
Using Cognitive Service Computer Vision API, Text Analytics API With Azure Logic App
  • Then, choose the Action for the workflow.
Using Cognitive Service Computer Vision API, Text Analytics API With Azure Logic App
  • Next, we sign in to OneDrive.
Using Cognitive Service Computer Vision API, Text Analytics API With Azure Logic App
  • We give permission to access our accounts.
Using Cognitive Service Computer Vision API, Text Analytics API With Azure Logic App
  • Next, Choose File Name and Table Name for saving the Image values. And, Then, Choose the Fields that you want
Using Cognitive Service Computer Vision API, Text Analytics API With Azure Logic App
  • Our Final WorkFlow Will be like this

    Using Cognitive Service Computer Vision API, Text Analytics API With Azure Logic App
Step 10

Now, we need to save the workflow and run it.

 

Output

Save an Image in the DropBox.

Using Cognitive Service Computer Vision API, Text Analytics API With Azure Logic App

Image

Using Cognitive Service Computer Vision API, Text Analytics API With Azure Logic App

Now, it extracts the Content, detects language, Keyphrases, and Sentiment values and saves those in an Excel Sheet (OneDrive).

Using Cognitive Service Computer Vision API, Text Analytics API With Azure Logic App

Summary

I hope you understood how to Convert the text which presents in the image to digital format and save the output into Excel file with the detection of Language, sentiment and key phrases using Microsoft Cognitive Services in Azure Logic App automatically. Stay tuned for more.