Skip to content

Latest commit

 

History

History
81 lines (62 loc) · 3.33 KB

17.Create and consume Cognitive Services.MD

File metadata and controls

81 lines (62 loc) · 3.33 KB

Create and consume Cognitive Services

  • Azure Cognitive Services encapsulate AI capabilities.
  • Cognitive services includes a wide range of individual AI services across multiple categories, as shown in the following table.
    Language	Speech	Vision	Decision
    Language	Speech	Computer Vision	Anomaly Detector
    Translator		Custom Vision	Content Moderator
    Face	Personalizer
    
  • use Cognitive Services to build your own AI solutions, and they also underpin Azure Applied AI Services that provide out-of-the-box solutions for common AI scenarios. Applied AI Services include:
    1. Azure Form Recognizer - an optical character recognition (OCR) solution that can extract semantic meaning from forms, such as invoices, receipts, and others.
    2. Azure Metrics Advisor - A service built on the Anomaly Detector cognitive service that simplifies real-time monitoring and response to critical metrics.
    3. Azure Video Analyzer for Media - A comprehensive video analysts solution build on the Video Indexer cognitive service.
    4. Azure Immersive Reader - A reading solution that supports people of all ages and abilities.
    5. Azure Bot Service - A cloud service for delivering conversational AI solutions, or bots.
    6. Azure Cognitive Search - A cloud-scale search solution that uses cognitive services to extract insights from data and documents.

Provision a cognitive services resource

  • Multi-service resource - supports multiple different cognitive services. For example, you could create a single resource that enables you to use the Language, Computer Vision, Speech, and other services. Single endpoint, credentials, billing for all services.

  • Single-service resource - individually, for example by creating discrete Language and Computer Vision resources. Separate endpoints , credentials, billing for each service.

  • Training and prediction resources - separate resources for model training and prediction. manage billing for training custom models separately

  • Use a REST API & SDK

Exercise - Use cognitive services

  folder01-getting-started/rest-client
  update config 
  C#: appsettings.json
  Python: .env

  review code
  C#: Program.cs
  Python: rest-client.py
  uses the GetLanguage function to call the Text Analytics language detectiont to detect the language of the text that was entered.

  run 
  C#
  dotnet run
  Python
  python rest-client.py

  Test : "Hello", "Bonjour", and "Gracias".

  01-getting-started/sdk-client

  C#
  dotnet add package Azure.AI.TextAnalytics --version 5.1.0

  Python
  pip install azure-ai-textanalytics==5.1.0

  C#: appsettings.json
  Python: .env

  C#: Program.cs
  Python: sdk-client.py

  C#
  dotnet run

  Python
  python sdk-client.py

  Test :  "Goodbye", "Au revoir", and "Hasta la vista".

Quiz

  1. How are client applications typically granted access to a cognitive services endpoint?
  • The application must specify a valid subscription key * [ ] The user of the application must enter a user name and password associated with the Azure subscription.
  • Access to cognitive services is granted to anonymous users by default.
  1. In which format are message exchanged between a client app and a cognitive services resource when using a REST API?
  • XML
  • JSON
  • HTML