Giter Site home page Giter Site logo

cognitive-function's Introduction

cognitive-function

Azure Functions integration with Cognitive Services

This function scans for a blob-storage container (specified by env variable Container) for images and send them over to Cognitive Services for Read-In.

The result is filtered by RegExp provided in env variable RegExpMatcher

The filtered result is loaded in CosmosDB database provided in env variable Database and Collection Collection

The cognitive services instance is configured to env variables CsUrl and CsAccessKey

There is PDF splitting Function in action as well configured with the input container PdfSplitter and output container ``PdfSplitteOutput```. These can be same as well.

The plitter can share container with form-recognizer. A filtering variable was added to support that: FRFilter. Even if the container are not shared, the filter should be at least '.pdf'.

Container names can include directory names

Running locally

Just create a local.settings.json with following:

{
    "IsEncrypted": false,
  "Values": {
    "AzureWebJobsStorage": "UseDevelopmentStorage=true",
    "FUNCTIONS_WORKER_RUNTIME": "dotnet",
    "Storage_Landing": "CONNECTION STRING TO MY STORAGE ACCOUNT",
    "CsUrl": "https:/MY-COGNITIVE-SERVICES-INSTANCE.cognitiveservices.azure.com/",
    "CsAccessKey": "MY-COGNITIVE-SERVICES-INSTANCE-ACCESSS-KEY",
    "RegExpMatcher": "SOMETHING|^y$",
    "Container": "blob-container-name-for-OCR",
    "ContainerFR": "blob-container-name-for-form-recognizer",
    "FRFilter": "File-ending filter for form-recognizer function (for example .pdf or page1.pdf)",
    "PdfSplitter": "blob-container-name-for-input-of-splitting-pdf",
    "PdfSplitteOutput": "blob-container-name-for-output-of-splitting-pdf (can be same as input)",
    "ModelId": "ID of the trained model of form-recognizer from the form-recognizer studio",
    "Database": "cosmos-database-name for ocr results",
    "Collection": "cosmos-database-collection-name for ocr results",
    "DatabaseFR": "cosmos-database-name for form-recognizer results,
    "CollectionFR": "cosmos-database-collection-name for form-recognizer results",
    "CosmosDBConnection": "CONNECTION STRING TO MY COSMOSDB"
  }
}

cognitive-function's People

Contributors

piizei avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.