How to build a personal finance app using Azure

Published 01-25-2021 04:25 PM 2,794 Views
Microsoft

AI allows you to deliver breakthrough experiences in your apps. With Azure Cognitive Services, you can easily customize and deploy the same AI models that power Microsoft’s products, such as Xbox and Bing, using the tools and languages of your choice.

In this blog we will walk through an exercise that you can complete in under an hour and learn how to build an application that can be useful for you, all while exploring a set of Azure services. If you have ever wanted to get your financial transactions in order, look no further. With this exercise, we’ll explore how to quickly take a snap of a receipt from your phone and upload it for categorization, creating expense reports, and to gain insights to your spending. Remember, even though we’ll walk you through each step, you can always explore the sample code and get creative with your own unique solution!

 

Features of the application:

  • Snap a picture of your receipt and upload it using your smartphone
  • Extract relevant data from the images: Who issued the receipt? What was the total amount? What was purchased? All of this information can be effortlessly stored for exploration
  • Query the data: bring your receipts to life by extracting relevant and insightful information

 

Prerequisites

  • If you don't have an Azure subscription, create a free account before you begin. If you have a subscription, log in to the Azure Portal.
  • You will need to have python installed locally to run some of the samples.

 

Key Azure technologies: 

 

Solution Architecture

ReceiptUploaderSolutionArchitecture.png

 

 

App Architecture Description: 

  • User uploads a receipt image from their mobile device
  • The uploaded image is verified and then sent to the Azure Form Recognizer to extract information
  • The image is analysed by the REST API within the Form Recognizer prebuilt receipt model
  • A JSON is returned that has both the text information and bounding box coordinates of the extracted receipt data
  • The resulting JSON is parsed and a simpler JSON is formed, saving only the relevant information needed
  • This receipt JSON is then stored in Azure Blob Storage
  • Azure Cognitive Search points directly to Azure Blob Storage and is used to index the data
  • The application queries this search index to extract relevant information from the receipts

Another visual of the flow of data within the solution architecture is shown below.

 

FlowChart.png

 

Now that we’ve explored the technology and services we’ll be using, let’s dive into building our app!

 

Implementation

To get started, data from receipts must be extracted; this is done by setting up the Form Recognizer service in Azure and connecting to the service to use the relevant API for receipts. A JSON is returned that contains the information extracted from receipts and is stored in Azure Blob Storage to be used by Azure Cognitive Search. Cognitive Search is then utilized to index the receipt data, and to search for relevant information.

 

High level overview of steps, along with sample code snippets for illustration:

  1. Go to the Azure portal and create a new Form Recognizer resource. In the Create pane, provide the following information:

Name

A descriptive name for your resource. 

Subscription

Select the Azure subscription which has been granted access.

Location

The location of your cognitive service instance. Different locations may introduce latency, but have no impact on the runtime availability of your resource.

Pricing Tier

The cost of your resource depends on the pricing tier you choose and your usage. For more information, see the API pricing details.

Resource Group

The Azure resource group that will contain your resource. You can create a new group or add it to a pre-existing group.

 

  1. After Form Recognizer deploys, go to All Resources and locate the newly deployed resource. Save the key and endpoint from the resource’s key and endpoint page somewhere so you can access it later.

  2. You can use the following Analyze Receipt API to start analyzing the receipt. Remember to replace <endpoint> & <subscription key> the values you saved earlier and replace <path to your receipt> with the local path to your scanned receipt image.
    # Analyse script
    
    import json
    import time
    from requests import get, post
    
    # Endpoint URL
    endpoint = r"<endpoint url>"
    apim_key = "<subscription key>"
    post_url = endpoint + "/formrecognizer/v2.0/prebuilt/receipt/analyze"
    source = r"<path to your receipt>"
    
    headers = {
        # Request headers
        'Content-Type': 'image/jpeg',
        'Ocp-Apim-Subscription-Key': apim_key,
    }
    
    params = {
        "includeTextDetails": True
    }
    
    with open(source, "rb") as f:
        data_bytes = f.read()
    
    try:
        resp = post(url=post_url, data=data_bytes, headers=headers, params=params)
        if resp.status_code != 202:
            print("POST analyze failed:\n%s" % resp.text)
            quit()
        print("POST analyze succeeded:\n%s" % resp.headers)
        get_url = resp.headers["operation-location"]
    except Exception as e:
        print("POST analyze failed:\n%s" % str(e))
        quit()
    ​
  3. If you run this code and everything is as it should be, you'll receive a 202 (Success) response that includes an Operation-Location header, which the script will print to the console. This header contains an operation id that you can use to query the status of the asynchronous operation and get the results. In the following example value, the string after operations/ is the operation ID.

 

https://cognitiveservice/formrecognizer/v2.0/prebuilt/receipt/operations/54f0b076-4e38-43e5-81bd-b85...

 

 

  1. Now you can call the Get Analyze Receipt Result API to get the Extracted Data.
    # Get results.
    n_tries = 10
    n_try = 0
    wait_sec = 6
    while n_try < n_tries:
        try:
            resp = get(url = get_url, headers = {"Ocp-Apim-Subscription-Key": apim_key})
            resp_json = json.loads(resp.text)
            if resp.status_code != 200:
                print("GET Receipt results failed:\n%s" % resp_json)
                quit()
            status = resp_json["status"]
            if status == "succeeded":
                print("Receipt Analysis succeeded:\n%s" % resp_json)
                quit()
            if status == "failed":
                print("Analysis failed:\n%s" % resp_json)
                quit()
            # Analysis still running. Wait and retry.
            time.sleep(wait_sec)
            n_try += 1
        except Exception as e:
            msg = "GET analyze results failed:\n%s" % str(e)
            print(msg)
            quit()
    ​

This code uses the operation id and makes another API call.

  1. The JSON that is returned can be examined to get the required information - ‘readResults’ field will contain all lines of text that was decipherable, and the ‘documentResults’ field contains ‘key/value’ information for the most relevant parts of the receipt (e.g. the merchant, total, line items etc.)

    The receipt image below,
    contosoReceipt.jpg

     

    resulted in the JSON from which we have extracted the following details:
     MerchantName: THE MAD HUNTER 
     TransactionDate: 2020-08-23 
     TransactionTime: 22:07:00 
     Total: £107.10 

 

  1. We will now create a JSON from all the data extracted from the analysed receipt. The structure of the JSON is shown below:
    {
       "id":"INV001",
       "user":"Sujith Kumar",
       "createdDateTime":"2020-10-23T17:16:32Z",
       "MerchantName":"THE MAD HUNTER",
       "TransactionDate":"2020-10-23",
       "TransactionTime":"22:07:00",
       "currency":"GBP",
       "Category":"Entertainment",
       "Total":"107.10",
       "Items":[	]
    }​

We can now save this JSON and build a search service to extract the information we want from it.

Before continuing onto step 8, you must have an Azure Storage Account with Blob storage.

  1. We will now save the JSON files in an Azure Blob Storage container and use it as a source for the Azure Cognitive Search Service Index that we will create.

  2. Sign-in to the Azure Portal and search for "Azure Cognitive Search" or navigate to the resource through Web > Azure Cognitive Search. Follow the steps to:
  • Choose a subscription
  • Set a resource group
  • Name the service appropriately
  • Choose a location
  • Choose a pricing tier for this service
  • Create your service
  • Get a key and URL endpoint

We will use the free Azure service, which means you can create three indexes, three data sources and three indexers. The dashboard will show you how many of each you have left. For this exercise you will create one of each.

 

  1. In the portal, find the search service you created above and click Import data on the command bar to start the wizard. In the wizard, click on Connect to your data and specify the name, type, and connection information. Skip the ‘Enrich Content’ page and go to Customize Target Index.

  2. For this exercise, we will use the wizard to generate a basic index for our receipt data. Minimally, an index requires a name and a fields collection; one of the fields should be marked as the document key to uniquely identify each document.

Fields have data types and attributes. The check boxes across the top are index attributes controlling how the field is used.

  • Retrievable means that it shows up in search results list. You can mark individual fields as off limits for search results by clearing this checkbox.
  • Key is the unique document identifier. It's always a string, and it is required.
  • FilterableSortable, and Facetable determine whether fields are used in a filter, sort, or faceted navigation structure.
  • Searchable means that a field is included in full text search. Only Strings are searchable.

 

Make sure you choose the following fields:

  • id  
  • user
  • createdDateTime
  • MerchantName  
  • TransactionDate
  • TransactionTime  
  • Currency
  • Category  
  • Total

 

  1. Still in the Import data wizard, click Indexer > Name, and type a name for the indexer.

This object defines an executable process. For now, use the default option (Once) to run the indexer once, immediately.

  1. Click Submit to create and simultaneously run the indexer.

Soon you should see the newly created indexer in the list, with status indicating "in progress" or success, along with the number of documents indexed.

The main service page provides links to the resources created in your Azure Cognitive Search service. To view the index you just created, click Indexes from the list of links.

step13.png

  1. Click on the index (azureblob-indexer in this case) from the list of links and view the index-schema.

Now you should have a search index that you can use to query the receipt data that’s been extracted from the uploaded receipts.

  1. Click the search explorer

15.png

  1. From the index drop down choose the relevant index. Choose the default API Version (2020-06-30) for this exercise.

16.png

  1. In the search bar paste a query string (for eg. category='Entertainment')

You will get results as verbose JSON documents as shown below:

17.png

 

Now that you have built a query indexer and aimed it at your data you can now use it to build queries programmatically and extract information to answer some of the following questions:

  • How much did I spend last Thursday?
  • How much have I spent on entertainment over the last quarter?
  • Did I spend anything at ‘The Crown and Pepper’ last month?

 

Additional Ideas

In addition to the services and functionalities used throughout this exercise, there are numerous other ways you can use Azure AI to build in support for all kinds of receipts or invoices. For example, the logo extractor can be used to identify logos of popular restaurants or hotel chains, and the business card model can ingest business contact information just as easily as we saw with receipts.

We encourage you to explore some of the following ideas to enrich your application:

  • Search invoices for specific line items
  • Train the models to recognize different expense categories such as entertainment, supplies, etc.
  • Add Language Understanding (LUIS) to ask your app questions in natural language and extract formatted reports
  • Add Azure QnA Maker to your app and get insights such as how much you spent on entertainment last month, or other categories of insights you’d like to explore
1 Comment
Occasional Visitor

:cool:

%3CLINGO-SUB%20id%3D%22lingo-sub-2088995%22%20slang%3D%22en-US%22%3EHow%20to%20build%20a%20personal%20finance%20app%20using%20Azure%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2088995%22%20slang%3D%22en-US%22%3E%3CP%3EAI%20allows%20you%20to%20deliver%20breakthrough%20experiences%20in%20your%20apps.%20With%20Azure%20Cognitive%20Services%2C%20you%20can%20easily%20customize%20and%20deploy%20the%20same%20AI%20models%20that%20power%20Microsoft%E2%80%99s%20products%2C%20such%20as%20Xbox%20and%20Bing%2C%20using%20the%20tools%20and%20languages%20of%20your%20choice.%3C%2FP%3E%0A%3CP%3EIn%20this%20blog%20we%20will%20walk%20through%20an%20exercise%20that%20you%20can%20complete%20in%20under%20an%20hour%20and%20learn%20how%20to%20build%20an%20application%20that%20can%20be%20useful%20for%20you%2C%20all%20while%20exploring%20a%20set%20of%20Azure%20services.%20If%20you%20have%20ever%20wanted%20to%20get%20your%20financial%20transactions%20in%20order%2C%20look%20no%20further.%20With%20this%20exercise%2C%20we%E2%80%99ll%20explore%20how%20to%20quickly%20take%20a%20snap%20of%20a%20receipt%20from%20your%20phone%20and%20upload%20it%20for%20categorization%2C%20creating%20expense%20reports%2C%20and%20to%20gain%20insights%20to%20your%20spending.%20Remember%2C%20even%20though%20we%E2%80%99ll%20walk%20you%20through%20each%20step%2C%20you%20can%20always%20explore%20the%20sample%20code%20and%20get%20creative%20with%20your%20own%20unique%20solution!%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3E%3CU%3EFeatures%20of%20the%20application%3A%3C%2FU%3E%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3ESnap%20a%20picture%20of%20your%20receipt%20and%20upload%20it%20using%20your%20smartphone%3C%2FLI%3E%0A%3CLI%3EExtract%20relevant%20data%20from%20the%20images%3A%20Who%20issued%20the%20receipt%3F%20What%20was%20the%20total%20amount%3F%20What%20was%20purchased%3F%20All%20of%20this%20information%20can%20be%20effortlessly%20stored%20for%20exploration%3C%2FLI%3E%0A%3CLI%3EQuery%20the%20data%3A%20bring%20your%20receipts%20to%20life%20by%20extracting%20relevant%20and%20insightful%20information%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3E%3CU%3EPrerequisites%3C%2FU%3E%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EIf%20you%20don't%20have%20an%20Azure%20subscription%2C%20create%20a%20%3CA%20href%3D%22https%3A%2F%2Fazure.microsoft.com%2Ffree%2Fcognitive-services%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Efree%20account%3C%2FA%3E%20before%20you%20begin.%20If%20you%20have%20a%20subscription%2C%20log%20in%20to%20the%20%3CA%20href%3D%22https%3A%2F%2Fazure.microsoft.com%2Fen-us%2Ffeatures%2Fazure-portal%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EAzure%20Portal%3C%2FA%3E%3CSPAN%3E.%3C%2FSPAN%3E%3C%2FLI%3E%0A%3CLI%3EYou%20will%20need%20to%20have%20%3CA%20href%3D%22https%3A%2F%2Fwww.python.org%2Fdownloads%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3Epython%3C%2FA%3E%20installed%20locally%20to%20run%20some%20of%20the%20samples.%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3E%3CSTRONG%3E%3CU%3EKey%26nbsp%3BAzure%20technologies%3A%3C%2FU%3E%3C%2FSTRONG%3E%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Fazure.microsoft.com%2Fen-us%2Fservices%2Fcognitive-services%2Fform-recognizer%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EAzure%20Form%20Recognizer%3C%2FA%3E%20scans%20image%20documents%20with%20optical%20character%20recognition%20and%20extracts%20text%2C%20key%2Fvalue%20pairs%2C%20and%20tables%20from%20documents%2C%20receipts%2C%20and%20forms.%3C%2FLI%3E%0A%3CLI%3EForm%20Recognizer%E2%80%99s%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fcognitive-services%2Fform-recognizer%2Fquickstarts%2Fpython-receipts%3Ftabs%3Dv2-0%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Eprebuilt%20receipt%20model%3C%2FA%3E%20specifically%20extracts%20receipt%20data%3C%2FLI%3E%0A%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Fazure.microsoft.com%2Fen-us%2Fservices%2Fstorage%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EAzure%20Blob%20Storage%3C%2FA%3E%20is%20used%20to%20store%20data%3C%2FLI%3E%0A%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Fazure.microsoft.com%2Fen-us%2Fservices%2Fsearch%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EAzure%20Cognitive%20Search%3C%2FA%3E%20enriches%20the%20data%20by%20making%20it%20easily%20identifiable%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CH2%20id%3D%22toc-hId--549128233%22%20id%3D%22toc-hId--549128233%22%20id%3D%22toc-hId--549956425%22%3E%26nbsp%3B%3C%2FH2%3E%0A%3CH2%20id%3D%22toc-hId-1938384600%22%20id%3D%22toc-hId-1938384600%22%20id%3D%22toc-hId-1937556408%22%3ESolution%20Architecture%3C%2FH2%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22ReceiptUploaderSolutionArchitecture.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F248818iEB5D2E8135093DAA%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22ReceiptUploaderSolutionArchitecture.png%22%20alt%3D%22ReceiptUploaderSolutionArchitecture.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3E%3CSTRONG%3E%3CU%3EApp%20Architecture%20Description%3A%3C%2FU%3E%3C%2FSTRONG%3E%3C%2FSPAN%3E%3CSPAN%3E%3CSTRONG%3E%26nbsp%3B%3C%2FSTRONG%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3E%3CSPAN%3EUser%20uploads%20a%20receipt%20image%20from%20their%20mobile%20device%3C%2FSPAN%3E%3C%2FLI%3E%0A%3CLI%3EThe%20uploaded%20image%20is%20verified%20and%20then%20sent%20to%20the%20Azure%20Form%20Recognizer%20to%20extract%20information%3C%2FLI%3E%0A%3CLI%3E%3CSPAN%3EThe%20image%20is%20analysed%20by%20the%20REST%20API%20within%20the%20Form%20Recognizer%20prebuilt%20receipt%20model%3C%2FSPAN%3E%3C%2FLI%3E%0A%3CLI%3E%3CSPAN%3EA%20JSON%20is%20returned%20that%20has%20both%20the%20text%20information%20and%20bounding%20box%20coordinates%20of%20the%20extracted%20receipt%20data%3C%2FSPAN%3E%3C%2FLI%3E%0A%3CLI%3EThe%20resulting%20JSON%20is%20parsed%20and%20a%20simpler%20JSON%20is%20formed%2C%20saving%20only%20the%20relevant%20information%20needed%3C%2FLI%3E%0A%3CLI%3E%3CSPAN%3EThis%20receipt%20JSON%20is%20then%20stored%20in%20Azure%20Blob%20Storage%20%3C%2FSPAN%3E%3C%2FLI%3E%0A%3CLI%3E%3CSPAN%3EAzure%20Cognitive%20Search%20points%20directly%20to%20Azure%20Blob%20Storage%20and%20is%20used%20to%20index%20the%20data%20%3C%2FSPAN%3E%3C%2FLI%3E%0A%3CLI%3E%3CSPAN%3EThe%20application%20queries%20this%20search%20index%20to%20extract%20relevant%20information%20from%20the%20receipts%3C%2FSPAN%3E%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%3CSPAN%3EAnother%20visual%20of%20the%20flow%20of%20data%20within%20the%20solution%20architecture%20is%20shown%20below.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22FlowChart.png%22%20style%3D%22width%3A%20602px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F249275i243E605E6E4CDDD1%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22FlowChart.png%22%20alt%3D%22FlowChart.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ENow%20that%20we%E2%80%99ve%20explored%20the%20technology%20and%20services%20we%E2%80%99ll%20be%20using%2C%20let%E2%80%99s%20dive%20into%20building%20our%20app!%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%225%22%3E%3CSTRONG%3EImplementation%3C%2FSTRONG%3E%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3ETo%20get%20started%2C%20data%20from%20receipts%20must%20be%20extracted%3B%20this%20is%20done%20by%20setting%20up%20the%20Form%20Recognizer%20service%20in%20Azure%20and%20connecting%20to%20the%20service%20to%20use%20the%20relevant%20API%20for%20receipts.%20A%20JSON%20is%20returned%20that%20contains%20the%20information%20extracted%20from%20receipts%20and%20is%20stored%20in%20Azure%20Blob%20Storage%20to%20be%20used%20by%20Azure%20Cognitive%20Search.%20Cognitive%20Search%20is%20then%20utilized%20to%20index%20the%20receipt%20data%2C%20and%20to%20search%20for%20relevant%20information.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3E%3CU%3EHigh%20level%20overview%20of%20steps%2C%20along%20with%20sample%20code%20snippets%20for%20illustration%3A%3C%2FU%3E%3C%2FSTRONG%3E%3C%2FP%3E%0A%3COL%3E%0A%3CLI%3EGo%20to%20the%20Azure%20portal%20and%26nbsp%3B%3CSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fms.portal.azure.com%2F%23create%2FMicrosoft.CognitiveServicesFormRecognizer%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3Ecreate%20a%20new%20Form%20Recognizer%20resource%3C%2FA%3E%3C%2FSPAN%3E.%20In%20the%26nbsp%3B%3CSTRONG%3ECreate%3C%2FSTRONG%3E%26nbsp%3Bpane%2C%20provide%20the%20following%20information%3A%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CTABLE%3E%0A%3CTBODY%3E%0A%3CTR%3E%0A%3CTD%20width%3D%22123%22%3E%3CP%3E%3CSTRONG%3EName%3C%2FSTRONG%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%22479%22%3E%3CP%3EA%20descriptive%20name%20for%20your%20resource.%26nbsp%3B%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20width%3D%22123%22%3E%3CP%3E%3CSTRONG%3ESubscription%3C%2FSTRONG%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%22479%22%3E%3CP%3ESelect%20the%20Azure%20subscription%20which%20has%20been%20granted%20access.%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20width%3D%22123%22%3E%3CP%3E%3CSTRONG%3ELocation%3C%2FSTRONG%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%22479%22%3E%3CP%3EThe%20location%20of%20your%20cognitive%20service%20instance.%20Different%20locations%20may%20introduce%20latency%2C%20but%20have%20no%20impact%20on%20the%20runtime%20availability%20of%20your%20resource.%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20width%3D%22123%22%3E%3CP%3E%3CSTRONG%3EPricing%20Tier%3C%2FSTRONG%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%22479%22%3E%3CP%3EThe%20cost%20of%20your%20resource%20depends%20on%20the%20pricing%20tier%20you%20choose%20and%20your%20usage.%20For%20more%20information%2C%20see%20the%20API%26nbsp%3B%3CSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fazure.microsoft.com%2Fpricing%2Fdetails%2Fcognitive-services%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Epricing%20details%3C%2FA%3E%3C%2FSPAN%3E.%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20width%3D%22123%22%3E%3CP%3E%3CSTRONG%3EResource%20Group%3C%2FSTRONG%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%22479%22%3E%3CP%3EThe%26nbsp%3B%3CSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fcloud-adoption-framework%2Fgovern%2Fresource-consistency%2Fresource-access-management%23what-is-an-azure-resource-group%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EAzure%20resource%20group%3C%2FA%3E%3C%2FSPAN%3E%26nbsp%3Bthat%20will%20contain%20your%20resource.%20You%20can%20create%20a%20new%20group%20or%20add%20it%20to%20a%20pre-existing%20group.%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3C%2FTBODY%3E%0A%3C%2FTABLE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3COL%20start%3D%222%22%3E%0A%3CLI%3EAfter%20Form%20Recognizer%20deploys%2C%20go%20to%20All%20Resources%20and%20locate%20the%20newly%20deployed%20resource.%20Save%20the%20key%20and%20endpoint%20from%20the%20resource%E2%80%99s%20key%20and%20endpoint%20page%20somewhere%20so%20you%20can%20access%20it%20later.%20%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FLI%3E%0A%3CLI%3EYou%20can%20use%20the%20following%20%3CSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fwestus2.dev.cognitive.microsoft.com%2Fdocs%2Fservices%2Fform-recognizer-api-v2%2Foperations%2FAnalyzeReceiptAsync%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EAnalyze%20Receipt%20API%3C%2FA%3E%3C%2FSPAN%3E%20to%20start%20analyzing%20the%20receipt.%20Remember%20to%20replace%20%3CENDPOINT%3E%20%26amp%3B%20%3CSUBSCRIPTION%20key%3D%22%22%3E%20the%20values%20you%20saved%20earlier%20and%20replace%20%3CPATH%20to%3D%22%22%20your%3D%22%22%20receipt%3D%22%22%3E%20with%20the%20local%20path%20to%20your%20scanned%20receipt%20image.%3CBR%20%2F%3E%3CPRE%20class%3D%22lia-code-sample%20language-python%22%3E%3CCODE%3E%23%20Analyse%20script%0A%0Aimport%20json%0Aimport%20time%0Afrom%20requests%20import%20get%2C%20post%0A%0A%23%20Endpoint%20URL%0Aendpoint%20%3D%20r%22%3CENDPOINT%20url%3D%22%22%3E%22%0Aapim_key%20%3D%20%22%3CSUBSCRIPTION%20key%3D%22%22%3E%22%0Apost_url%20%3D%20endpoint%20%2B%20%22%2Fformrecognizer%2Fv2.0%2Fprebuilt%2Freceipt%2Fanalyze%22%0Asource%20%3D%20r%22%3CPATH%20to%3D%22%22%20your%3D%22%22%20receipt%3D%22%22%3E%22%0A%0Aheaders%20%3D%20%7B%0A%20%20%20%20%23%20Request%20headers%0A%20%20%20%20'Content-Type'%3A%20'image%2Fjpeg'%2C%0A%20%20%20%20'Ocp-Apim-Subscription-Key'%3A%20apim_key%2C%0A%7D%0A%0Aparams%20%3D%20%7B%0A%20%20%20%20%22includeTextDetails%22%3A%20True%0A%7D%0A%0Awith%20open(source%2C%20%22rb%22)%20as%20f%3A%0A%20%20%20%20data_bytes%20%3D%20f.read()%0A%0Atry%3A%0A%20%20%20%20resp%20%3D%20post(url%3Dpost_url%2C%20data%3Ddata_bytes%2C%20headers%3Dheaders%2C%20params%3Dparams)%0A%20%20%20%20if%20resp.status_code%20!%3D%20202%3A%0A%20%20%20%20%20%20%20%20print(%22POST%20analyze%20failed%3A%5Cn%25s%22%20%25%20resp.text)%0A%20%20%20%20%20%20%20%20quit()%0A%20%20%20%20print(%22POST%20analyze%20succeeded%3A%5Cn%25s%22%20%25%20resp.headers)%0A%20%20%20%20get_url%20%3D%20resp.headers%5B%22operation-location%22%5D%0Aexcept%20Exception%20as%20e%3A%0A%20%20%20%20print(%22POST%20analyze%20failed%3A%5Cn%25s%22%20%25%20str(e))%0A%20%20%20%20quit()%0A%E2%80%8B%3C%2FPATH%3E%3C%2FSUBSCRIPTION%3E%3C%2FENDPOINT%3E%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FPATH%3E%3C%2FSUBSCRIPTION%3E%3C%2FENDPOINT%3E%3C%2FLI%3E%0A%3CLI%3EIf%20you%20run%20this%20code%20and%20everything%20is%20as%20it%20should%20be%2C%20you'll%20receive%20a%26nbsp%3B%3CSTRONG%3E202%20(Success)%3C%2FSTRONG%3E%26nbsp%3Bresponse%20that%20includes%20an%26nbsp%3B%3CSTRONG%3EOperation-Location%3C%2FSTRONG%3E%26nbsp%3Bheader%2C%20which%20the%20script%20will%20print%20to%20the%20console.%20This%20header%20contains%20an%20%3CSTRONG%3Eoperation%20id%3C%2FSTRONG%3E%20that%20you%20can%20use%20to%20query%20the%20status%20of%20the%20asynchronous%20operation%20and%20get%20the%20results.%20In%20the%20following%20example%20value%2C%20the%20string%20after%26nbsp%3Boperations%2F%26nbsp%3Bis%20the%20operation%20ID.%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CTABLE%3E%0A%3CTBODY%3E%0A%3CTR%3E%0A%3CTD%20width%3D%22601%22%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fcognitiveservice%2Fformrecognizer%2Fv2.0%2Fprebuilt%2Freceipt%2Foperations%2F54f0b076-4e38-43e5-81bd-b85b8835fdfb%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3Ehttps%3A%2F%2Fcognitiveservice%2Fformrecognizer%2Fv2.0%2Fprebuilt%2Freceipt%2Foperations%2F54f0b076-4e38-43e5-81bd-b85b8835fdfb%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3C%2FTBODY%3E%0A%3C%2FTABLE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3COL%20start%3D%225%22%3E%0A%3CLI%3ENow%20you%20can%20call%20the%26nbsp%3B%3CSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fwestus2.dev.cognitive.microsoft.com%2Fdocs%2Fservices%2Fform-recognizer-api-v2%2Foperations%2FGetAnalyzeReceiptResult%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3E%3CSTRONG%3EGet%20Analyze%20Receipt%20Result%3C%2FSTRONG%3E%3C%2FA%3E%3C%2FSPAN%3E%26nbsp%3BAPI%20to%20get%20the%20Extracted%20Data.%3CBR%20%2F%3E%3CPRE%20class%3D%22lia-code-sample%20language-python%22%3E%3CCODE%3E%23%20Get%20results.%0An_tries%20%3D%2010%0An_try%20%3D%200%0Await_sec%20%3D%206%0Awhile%20n_try%20%26lt%3B%20n_tries%3A%0A%20%20%20%20try%3A%0A%20%20%20%20%20%20%20%20resp%20%3D%20get(url%20%3D%20get_url%2C%20headers%20%3D%20%7B%22Ocp-Apim-Subscription-Key%22%3A%20apim_key%7D)%0A%20%20%20%20%20%20%20%20resp_json%20%3D%20json.loads(resp.text)%0A%20%20%20%20%20%20%20%20if%20resp.status_code%20!%3D%20200%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20print(%22GET%20Receipt%20results%20failed%3A%5Cn%25s%22%20%25%20resp_json)%0A%20%20%20%20%20%20%20%20%20%20%20%20quit()%0A%20%20%20%20%20%20%20%20status%20%3D%20resp_json%5B%22status%22%5D%0A%20%20%20%20%20%20%20%20if%20status%20%3D%3D%20%22succeeded%22%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20print(%22Receipt%20Analysis%20succeeded%3A%5Cn%25s%22%20%25%20resp_json)%0A%20%20%20%20%20%20%20%20%20%20%20%20quit()%0A%20%20%20%20%20%20%20%20if%20status%20%3D%3D%20%22failed%22%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20print(%22Analysis%20failed%3A%5Cn%25s%22%20%25%20resp_json)%0A%20%20%20%20%20%20%20%20%20%20%20%20quit()%0A%20%20%20%20%20%20%20%20%23%20Analysis%20still%20running.%20Wait%20and%20retry.%0A%20%20%20%20%20%20%20%20time.sleep(wait_sec)%0A%20%20%20%20%20%20%20%20n_try%20%2B%3D%201%0A%20%20%20%20except%20Exception%20as%20e%3A%0A%20%20%20%20%20%20%20%20msg%20%3D%20%22GET%20analyze%20results%20failed%3A%5Cn%25s%22%20%25%20str(e)%0A%20%20%20%20%20%20%20%20print(msg)%0A%20%20%20%20%20%20%20%20quit()%0A%E2%80%8B%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3EThis%20code%20uses%20the%20operation%20id%20and%20makes%20another%20API%20call.%20%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%0A%3COL%20start%3D%226%22%3E%0A%3CLI%3EThe%20JSON%20that%20is%20returned%20can%20be%20examined%20to%20get%20the%20required%20information%20-%20%E2%80%98readResults%E2%80%99%20field%20will%20contain%20all%20lines%20of%20text%20that%20was%20decipherable%2C%20and%20the%20%E2%80%98documentResults%E2%80%99%20field%20contains%20%E2%80%98key%2Fvalue%E2%80%99%20information%20for%20the%20most%20relevant%20parts%20of%20the%20receipt%20(e.g.%20the%20merchant%2C%20total%2C%20line%20items%20etc.)%3CSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FSPAN%3EThe%20receipt%20image%20below%2C%20%3CSPAN%3E%3CBR%20%2F%3E%3C%2FSPAN%3E%20%3CSPAN%3E%3CSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22contosoReceipt.jpg%22%20style%3D%22width%3A%20496px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F249243iEE3167D5881B66D2%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22contosoReceipt.jpg%22%20alt%3D%22contosoReceipt.jpg%22%20%2F%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3CP%3E%26nbsp%3B%3C%2FP%3Eresulted%20in%20the%20JSON%20from%20which%20we%20have%20extracted%20the%20following%20details%3A%20%3CSPAN%3E%3CSPAN%3E%3CBR%20%2F%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3CPRE%20class%3D%22lia-code-sample%20language-json%22%3E%3CCODE%3E%20MerchantName%3A%20THE%20MAD%20HUNTER%20%0A%20TransactionDate%3A%202020-08-23%20%0A%20TransactionTime%3A%2022%3A07%3A00%20%0A%20Total%3A%20%C2%A3107.10%20%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3COL%20start%3D%227%22%3E%0A%3CLI%3EWe%20will%20now%20create%20a%20JSON%20from%20all%20the%20data%20extracted%20from%20the%20analysed%20receipt.%20The%20structure%20of%20the%20JSON%20is%20shown%20below%3A%3CBR%20%2F%3E%3CPRE%20class%3D%22lia-code-sample%20language-python%22%3E%3CCODE%3E%7B%0A%20%20%20%22id%22%3A%22INV001%22%2C%0A%20%20%20%22user%22%3A%22Sujith%20Kumar%22%2C%0A%20%20%20%22createdDateTime%22%3A%222020-10-23T17%3A16%3A32Z%22%2C%0A%20%20%20%22MerchantName%22%3A%22THE%20MAD%20HUNTER%22%2C%0A%20%20%20%22TransactionDate%22%3A%222020-10-23%22%2C%0A%20%20%20%22TransactionTime%22%3A%2222%3A07%3A00%22%2C%0A%20%20%20%22currency%22%3A%22GBP%22%2C%0A%20%20%20%22Category%22%3A%22Entertainment%22%2C%0A%20%20%20%22Total%22%3A%22107.10%22%2C%0A%20%20%20%22Items%22%3A%5B%20%5D%0A%7D%E2%80%8B%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3EWe%20can%20now%20save%20this%20JSON%20and%20build%20a%20search%20service%20to%20extract%20the%20information%20we%20want%20from%20it.%3C%2FP%3E%0A%3CP%3EBefore%20continuing%20onto%20step%208%2C%20you%20must%20have%20an%20Azure%20Storage%20Account%20with%20Blob%20storage.%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%0A%3COL%20start%3D%228%22%3E%0A%3CLI%3EWe%20will%20now%20save%20the%20JSON%20files%20in%20an%20%3CSTRONG%3EAzure%20Blob%20Storage%3C%2FSTRONG%3E%20container%20and%20use%20it%20as%20a%20source%20for%20the%20%3CSTRONG%3EAzure%20Cognitive%20Search%20Service%20Index%3C%2FSTRONG%3E%20that%20we%20will%20create.%20%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FLI%3E%0A%3CLI%3ESign-in%20to%20the%20Azure%20Portal%20and%20search%20for%20%22Azure%20Cognitive%20Search%22%20or%20navigate%20to%20the%20resource%20through%26nbsp%3B%3CSTRONG%3EWeb%3C%2FSTRONG%3E%26nbsp%3B%26gt%3B%26nbsp%3B%3CSTRONG%3EAzure%20Cognitive%20Search%3C%2FSTRONG%3E.%20Follow%20the%20steps%20to%3A%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CUL%3E%0A%3CLI%3EChoose%20a%20subscription%3C%2FLI%3E%0A%3CLI%3ESet%20a%20resource%20group%3C%2FLI%3E%0A%3CLI%3EName%20the%20service%20appropriately%3C%2FLI%3E%0A%3CLI%3EChoose%20a%20location%3C%2FLI%3E%0A%3CLI%3EChoose%20a%20pricing%20tier%20for%20this%20service%3C%2FLI%3E%0A%3CLI%3ECreate%20your%20service%3C%2FLI%3E%0A%3CLI%3EGet%20a%20key%20and%20URL%20endpoint%20%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3EWe%20will%20use%20the%20free%20Azure%20service%2C%20which%20means%20you%20can%20create%20three%20indexes%2C%20three%20data%20sources%20and%20three%20indexers.%20The%20dashboard%20will%20show%20you%20how%20many%20of%20each%20you%20have%20left.%20For%20this%20exercise%20you%20will%20create%20one%20of%20each.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3COL%20start%3D%2210%22%3E%0A%3CLI%3EIn%20the%20portal%2C%20find%20the%20search%20service%20you%20created%20above%20and%20click%20%3CSTRONG%3EImport%20data%3C%2FSTRONG%3E%20on%20the%20command%20bar%20to%20start%20the%20wizard.%20In%20the%20wizard%2C%20click%20on%20Connect%20to%20your%20data%20and%20specify%20the%20name%2C%20type%2C%20and%20connection%20information.%20Skip%20the%20%E2%80%98Enrich%20Content%E2%80%99%20page%20and%20go%20to%20%3CSTRONG%3ECustomize%20Target%20Index.%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FSTRONG%3E%3C%2FLI%3E%0A%3CLI%3EFor%20this%20exercise%2C%20we%20will%20use%20the%20wizard%20to%20generate%20a%20basic%20index%20for%20our%20receipt%20data.%20Minimally%2C%20an%20index%20requires%20a%20name%20and%20a%20fields%20collection%3B%20one%20of%20the%20fields%20should%20be%20marked%20as%20the%20document%20key%20to%20uniquely%20identify%20each%20document.%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3EFields%20have%20data%20types%20and%20attributes.%20The%20check%20boxes%20across%20the%20top%20are%26nbsp%3B%3CEM%3Eindex%20attributes%3C%2FEM%3E%26nbsp%3Bcontrolling%20how%20the%20field%20is%20used.%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3E%3CSTRONG%3ERetrievable%3C%2FSTRONG%3E%26nbsp%3Bmeans%20that%20it%20shows%20up%20in%20search%20results%20list.%20You%20can%20mark%20individual%20fields%20as%20off%20limits%20for%20search%20results%20by%20clearing%20this%20checkbox.%3C%2FLI%3E%0A%3CLI%3E%3CSTRONG%3EKey%3C%2FSTRONG%3E%26nbsp%3Bis%20the%20unique%20document%20identifier.%20It's%20always%20a%20string%2C%20and%20it%20is%20required.%3C%2FLI%3E%0A%3CLI%3E%3CSTRONG%3EFilterable%3C%2FSTRONG%3E%2C%26nbsp%3B%3CSTRONG%3ESortable%3C%2FSTRONG%3E%2C%20and%26nbsp%3B%3CSTRONG%3EFacetable%3C%2FSTRONG%3E%26nbsp%3Bdetermine%20whether%20fields%20are%20used%20in%20a%20filter%2C%20sort%2C%20or%20faceted%20navigation%20structure.%3C%2FLI%3E%0A%3CLI%3E%3CSTRONG%3ESearchable%3C%2FSTRONG%3E%26nbsp%3Bmeans%20that%20a%20field%20is%20included%20in%20full%20text%20search.%20Only%20Strings%20are%20searchable.%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EMake%20sure%20you%20choose%20the%20following%20fields%3A%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3Eid%26nbsp%3B%26nbsp%3B%3C%2FLI%3E%0A%3CLI%3Euser%3C%2FLI%3E%0A%3CLI%3EcreatedDateTime%3C%2FLI%3E%0A%3CLI%3EMerchantName%26nbsp%3B%26nbsp%3B%3C%2FLI%3E%0A%3CLI%3ETransactionDate%3C%2FLI%3E%0A%3CLI%3ETransactionTime%26nbsp%3B%26nbsp%3B%3C%2FLI%3E%0A%3CLI%3ECurrency%3C%2FLI%3E%0A%3CLI%3ECategory%26nbsp%3B%26nbsp%3B%3C%2FLI%3E%0A%3CLI%3ETotal%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3COL%20start%3D%2212%22%3E%0A%3CLI%3EStill%20in%20the%26nbsp%3B%3CSTRONG%3EImport%20data%3C%2FSTRONG%3E%26nbsp%3Bwizard%2C%20click%26nbsp%3B%3CSTRONG%3EIndexer%3C%2FSTRONG%3E%26nbsp%3B%26gt%3B%26nbsp%3B%3CSTRONG%3EName%3C%2FSTRONG%3E%2C%20and%20type%20a%20name%20for%20the%20indexer.%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3EThis%20object%20defines%20an%20executable%20process.%20For%20now%2C%20use%20the%20default%20option%20(%3CSTRONG%3EOnce%3C%2FSTRONG%3E)%20to%20run%20the%20indexer%20once%2C%20immediately.%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%0A%3COL%20start%3D%2213%22%3E%0A%3CLI%3EClick%26nbsp%3B%3CSTRONG%3ESubmit%3C%2FSTRONG%3E%26nbsp%3Bto%20create%20and%20simultaneously%20run%20the%20indexer.%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3ESoon%20you%20should%20see%20the%20newly%20created%20indexer%20in%20the%20list%2C%20with%20status%20indicating%20%22in%20progress%22%20or%20success%2C%20along%20with%20the%20number%20of%20documents%20indexed.%3C%2FP%3E%0A%3CP%3EThe%20main%20service%20page%20provides%20links%20to%20the%20resources%20created%20in%20your%20Azure%20Cognitive%20Search%20service.%20To%20view%20the%20index%20you%20just%20created%2C%20click%26nbsp%3B%3CSTRONG%3EIndexes%3C%2FSTRONG%3E%26nbsp%3Bfrom%20the%20list%20of%20links.%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-left%22%20image-alt%3D%22step13.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F248821iFBF89B5FE72FA88E%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22step13.png%22%20alt%3D%22step13.png%22%20%2F%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%0A%3COL%20start%3D%2214%22%3E%0A%3CLI%3EClick%20on%20the%20index%20(%3CEM%3Eazureblob-indexer%3C%2FEM%3E%20in%20this%20case)%20from%20the%20list%20of%20links%20and%20view%20the%20index-schema.%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3ENow%20you%20should%20have%20a%20search%20index%20that%20you%20can%20use%20to%20query%20the%20receipt%20data%20that%E2%80%99s%20been%20extracted%20from%20the%20uploaded%20receipts.%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%0A%3COL%20start%3D%2215%22%3E%0A%3CLI%3EClick%20the%20search%20explorer%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-left%22%20image-alt%3D%2215.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F249238i4DD762412E1DBF15%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%2215.png%22%20alt%3D%2215.png%22%20%2F%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%0A%3COL%20start%3D%2216%22%3E%0A%3CLI%3EFrom%20the%20index%20drop%20down%20choose%20the%20relevant%20index.%20Choose%20the%20default%20API%20Version%20(2020-06-30)%20for%20this%20exercise.%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-left%22%20image-alt%3D%2216.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F249276i6A72C8DAABEBDD28%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%2216.png%22%20alt%3D%2216.png%22%20%2F%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%0A%3COL%20start%3D%2217%22%3E%0A%3CLI%3EIn%20the%20search%20bar%20paste%20a%20query%20string%20(for%20eg.%20%3CSTRONG%3Ecategory%3D'Entertainment'%3C%2FSTRONG%3E)%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3EYou%20will%20get%20results%20as%20verbose%20JSON%20documents%20as%20shown%20below%3A%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-left%22%20image-alt%3D%2217.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F248827iD8A00676A9051ED7%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%2217.png%22%20alt%3D%2217.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ENow%20that%20you%20have%20built%20a%20query%20indexer%20and%20aimed%20it%20at%20your%20data%20you%20can%20now%20use%20it%20to%20build%20queries%20programmatically%20and%20extract%20information%20to%20answer%20some%20of%20the%20following%20questions%3A%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EHow%20much%20did%20I%20spend%20last%20Thursday%3F%3C%2FLI%3E%0A%3CLI%3EHow%20much%20have%20I%20spent%20on%20entertainment%20over%20the%20last%20quarter%3F%3C%2FLI%3E%0A%3CLI%3EDid%20I%20spend%20anything%20at%20%E2%80%98The%20Crown%20and%20Pepper%E2%80%99%20last%20month%3F%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId-130930137%22%20id%3D%22toc-hId-130930137%22%20id%3D%22toc-hId-130101945%22%3EAdditional%20Ideas%3C%2FH2%3E%0A%3CP%3EIn%20addition%20to%20the%20services%20and%20functionalities%20used%20throughout%20this%20exercise%2C%20there%20are%20numerous%20other%20ways%20you%20can%20use%20Azure%20AI%20to%20build%20in%20support%20for%20all%20kinds%20of%20receipts%20or%20invoices.%20For%20example%2C%20the%20logo%20extractor%20can%20be%20used%20to%20identify%20logos%20of%20popular%20restaurants%20or%20hotel%20chains%2C%20and%20the%20business%20card%20model%20can%20ingest%20business%20contact%20information%20just%20as%20easily%20as%20we%20saw%20with%20receipts.%3C%2FP%3E%0A%3CP%3EWe%20encourage%20you%20to%20explore%20some%20of%20the%20following%20ideas%20to%20enrich%20your%20application%3A%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3ESearch%20invoices%20for%20specific%20line%20items%3C%2FLI%3E%0A%3CLI%3ETrain%20the%20models%20to%20recognize%20different%20expense%20categories%20such%20as%20entertainment%2C%20supplies%2C%20etc.%3C%2FLI%3E%0A%3CLI%3EAdd%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-gb%2Fazure%2Fcognitive-services%2FLUIS%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3E%3CSTRONG%3ELanguage%20Understanding%20(LUIS)%3C%2FSTRONG%3E%3C%2FA%3E%20to%20ask%20your%20app%20questions%20in%20natural%20language%20and%20extract%20formatted%20reports%3C%2FLI%3E%0A%3CLI%3EAdd%20%3CA%20href%3D%22https%3A%2F%2Fazure.microsoft.com%2Fservices%2Fcognitive-services%2Fqna-maker%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3E%3CSTRONG%3EAzure%20QnA%20Maker%3C%2FSTRONG%3E%3C%2FA%3E%20to%20your%20app%20and%20get%20insights%20such%20as%20how%20much%20you%20spent%20on%20entertainment%20last%20month%2C%20or%20other%20categories%20of%20insights%20you%E2%80%99d%20like%20to%20explore%3C%2FLI%3E%0A%3C%2FUL%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-2088995%22%20slang%3D%22en-US%22%3E%3CP%3ELearn%20how%20to%20build%20an%20app%20that%20can%20help%20you%20manage%20personal%20expenses%2C%20using%20Azure%20AI.%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22personal%20finance%20image.png%22%20style%3D%22width%3A%20740px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F249272iA97F194E6D299F8A%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22personal%20finance%20image.png%22%20alt%3D%22personal%20finance%20image.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2088995%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAzure%20Cognitive%20Search%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ECognitive%20Services%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EForm%20Recognizer%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EKnowledge%20Mining%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2097517%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20build%20a%20personal%20finance%20app%20using%20Azure%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2097517%22%20slang%3D%22en-US%22%3E%3CP%3E%3CIMG%20class%3D%22lia-deferred-image%20lia-image-emoji%22%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Fhtml%2Fimages%2Femoticons%2Fcool_40x40.gif%22%20alt%3D%22%3Acool%3A%22%20title%3D%22%3Acool%3A%22%20%2F%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E
Version history
Last update:
‎Jan 25 2021 05:19 PM
Updated by: