Giter Club home page Giter Club logo

cognitive-container-sample's Introduction

Cognitive Container Sample

Azure Cognitive Services are a powerful set of tools that perform Cognitive functions ranging from speech recognition, translation, generation to image processing.

These are made available as a series of APIs that are provisioned in the Azure portal. These are essentially multi-tenant services - that is they are shared between the different Azure customers. For many customers, this is adequate.

Some customers want to use Cognitive Services, but also want much tighter control on the service itself, whilst others want to be able to run these Cognitive services offline.

Cognitive Services in a Container

To allow customers a higher degree of control, some Cognitive services will be deployable inside container technologies such as Azure Kubernetes Service (AKS) or Azure Container Instances (ACI).

alt text

The above diagram shows a function app interacting with Cognitive Speech in a container. The function app takes some inbound audio either from an MP3 file and processes it so that the speech transcription service can perform the transcription. This is just one sample configuration.

This is currently a preview feature and there is a process where some developers can request access to an Azure Container Registry (ACR) that contains these preview Docker images.

There is some documentation here that shows you how to configure Cognitive Services in a simple container.

It should also be noted that to allow Microsoft to bill you for the use of these Cognitive Services, you need to configure the container with the URL and API key of an existing normal PaaS Cognitive Services account. It should be noted that this account will only be used for billing purposes - when clients of Cognitive Services are configured to call a container-based instance, then the cognitive requests will only go the the container, but your PaaS Cognitive Service will receive the billing requests.

Coding against the container-based version

Fundamentally the coding model for the container-based version is identical to that of the existing SDKs. But the main change that needs to be made to the code is how the connection is made from the SDK to the container-based cognitive services. This is discussed in detail here.

In summary, the connection code must be changed from:

var config = SpeechConfig.FromSubscription("YourSubscriptionKey", "YourServiceRegion");

to use a container endpoint:

var config = SpeechConfig.FromEndpoint(
    new Uri("ws://<container-ip-address>:5000/speech/recognition/dictation/cognitiveservices/v1"),
    "YourSubscriptionKey");

The starting point for any coding is best taken from the Speech SDK

This sample is the starting point for any test changes that can be made to point to a container-based Cognitive Services speech demonstration.

It should be noted that this container does not support the batch REST API that my cognitive-speech sample uses. Therefore this demonstation has to use the SDK rather than pure HTTP REST calls.

The demonstration

This section will detail what the demonstration will do in non-technical terms. This could be the same as the other cognitive speech demonstration, but a slightly different demonstration may be best.

Watch this space

cognitive-container-sample's People

Contributors

jometzg avatar

Watchers

James Cloos avatar  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.