They enable machines to see, hear, speak, understand and interpret user needs by employing natural methods of communication. Azure Cognitive Services make it easy for developers to incorporate these intelligent capabilities into their applications. One of these capabilities is attaching a Cognitive Services account to a skillset for a comprehensive and dynamic use of the AI features. This article focuses on learning how to attach a Cognitive Services account to a skillset in Azure AI solutions. This is a topic key to preparing for the AI-102 Designing and Implementing a Microsoft Azure AI Solution exam.
A skillset in Azure is a set of skills that defines the series of tasks an object performs on data. Skills can be those provided by Microsoft, or developers can build custom skills. While creating a skillset, you may have to provide a Cognitive Services account to a skillset, so that the skills performing the tasks can use that Cognitive Services account for different purposes.
Before we get started, it’s critical to have a Cognitive Services resource created in your Azure account. If you don’t have a Cognitive Services resource, you can create one by following this Azure guide on ‘How to create a Cognitive Services resource’.
Attaching a Cognitive Services Account to a Skillset
To link a Cognitive Services account to a skillset, we will specify its details in the skillset definition.
While creating or modifying a skillset, a section “cognitiveServices” is included in the JSON payload. In this section, you need to provide the “@odata.type” property with “#Microsoft.Azure.Search.CognitiveServicesByKey”, which signifies that we’re using a specific Cognitive Services account. Subsequently, the “description” property defines what this account is used for and the key details are provided under the “account” and “key” properties.
Below is an example of a simple skillset JSON payload where we are specifying the details of a Cognitive Services account:
{
“name”: “my-skillset”,
“skills”: [],
“cognitiveServices”: {
“@odata.type”: “#Microsoft.Azure.Search.CognitiveServicesByKey”,
“description”: “my cognitive services account”,
“account”: “https://my-cognitive-services.cognitiveservices.azure.com/”,
“key”: “my-cognitive-services-key”
}
}
Please replace “https://my-cognitive-services.cognitiveservices.azure.com/” with your Cognitive Services resource’s endpoint and “my-cognitive-services-key” with your Cognitive Services resource key.
If you are using a custom skill, you could potentially use another Cognitive Services resource for that skill.
Conclusion
Attaching a Cognitive Services account to a skillset allows extending the capability of AI to perform tasks using the Cognitive Services account. This forms a crucial aspect of AI-102: Designing and Implementing a Microsoft Azure AI Solution exam and gives an in-depth understanding of how cognitive services can be linked with skillsets to create an efficient and intelligent AI system. We’ve seen how to define this relationship using the JSON payload representing a skillset.
References:
- Azure Cognitive Services Documentation: https://docs.microsoft.com/azure/cognitive-services/
- Skillsets in Azure Search: https://docs.microsoft.com/azure/search/cognitive-search-concept-skillsets
- How to create a Cognitive Services resource: https://docs.microsoft.com/azure/cognitive-services/cognitive-services-apis-create-account
Practice Test
True or False: A Cognitive Services account can be attached to a skillset in Azure.
- True
- False
Correct answer: True
Explanation: A Cognitive Services account can indeed be attached to an Azure skillset. This process enhances the capabilities of the skillset.
Which of the following Microsoft services do you need to utilize to attach a Cognitive Services account to a skillset?
- a) Bing Search
- b) Azure Bot Services
- c) Azure Cognitive Services
- d) Azure Face API
Correct answer: c) Azure Cognitive Services
Explanation: Azure Cognitive Services provide the API that we use to attach a Cognitive Services account to a skillset.
True or False: You have to create separate Cognitive Services accounts for each skillset.
- True
- False
Correct answer: False
Explanation: You can use a single Cognitive Services account to work with multiple skillsets.
In what format does a skillset in Azure accept a Cognitive Services account?
- a) JSON
- b) XML
- c) CSV
- d) TXT
Correct answer: a) JSON
Explanation: The Cognitive Services account is submitted in a skillset in the JSON format.
True or False: You cannot modify the Cognitive Services account associated with a skillset once it’s created.
- True
- False
Correct answer: False
Explanation: You can modify the Cognitive Services account at any time after it has been attached to a skillset.
Which of the following Azure services is necessary when you are attaching a Cognitive Services account to a skillset?
- a) Azure Resource Manager
- b) Azure Media Services
- c) Cognitive Search
- d) Azure Logic Apps
Correct answer: c) Cognitive Search
Explanation: When attaching a Cognitive Services account to a skillset, Cognitive Search is the service in Azure that gets utilized.
True or False: Attaching a Cognitive Services account to a skillset enhances the capabilities of the skillset.
- True
- False
Correct answer: True
Explanation: When you attach a Cognitive Services account to a skillset, you are enhancing its capabilities by introducing additional features.
You can attach a Cognitive Services account to a skillset using the Azure portal.
- a) True
- b) False
Correct answer: a) True
Explanation: You can use the Azure portal to attach a Cognitive Services account to a skillset.
To attach a Cognitive Services account to a skillset, you need to use which of the following experiences?
- a) ARM template
- b) PowerShell
- c) Azure portal
- d) All of the above
Correct answer: d) All of the above
Explanation: You can use any of those experiences to attach a Cognitive Services account to a skillset.
What cognitive skills are added to a skillset when a Cognitive Services account is attached to it?
- a) Speech to Text
- b) Text to Speech
- c) Language Understanding
- d) All of the above
Correct answer: d) All of the above
Explanation: When a Cognitive Services account is attached, it provides all cognitive skills like Speech to Text, Text to Speech, Language Understanding, and many more.
You can use the REST API to attach a Cognitive Services account to a skillset.
- a) True
- b) False
Correct answer: a) True
Explanation: The REST API can be used to perform this operation.
Which of the following Azure service is not typically involved when you are attaching a Cognitive Services account to a skillset?
- a) Azure Functions
- b) Azure Cognitive Search
- c) Azure Cognitive Services
- d) Azure Web Apps
Correct answer: d) Azure Web Apps
Explanation: Azure Web Apps is not typically involved when attaching a Cognitive Services account to a skillset.
Interview Questions
What is a Cognitive Services account in Microsoft Azure?
A Cognitive Services account in Microsoft Azure is an account type for managing and utilizing machine learning algorithms for vision, speech, language, decision, and web search services.
What is a skillset in Azure Search?
A skillset in Azure Search defines a series of enrichment steps or skills, which use AI processes to transform and enrich the data during indexing.
How do you connect a Cognitive Services account to a skillset in Azure?
A Cognitive Services account can be attached to a skillset in Azure during the skillset creation process by specifying the Cognitive Services resource details in the ‘cognitiveServices’ section of the skillset definition.
Why would you want to attach a Cognitive Services account to a skillset?
Attaching a Cognitive Services account to a skillset enables the application of AI enrichment steps during data ingestion and indexing, providing powerful and advanced search capabilities like image recognition, sentiment analysis, and language understanding.
What types of Cognitive Services can be attached to a skillset?
Various types of Cognitive Services can be attached to a skillset, including Text Analytics API, Bing Entity Search API, Computer Vision API, and others depending on the specific requirements of the data enrichment process.
Can you attach multiple Cognitive Services to a single skillset in Azure Search?
Yes, you can attach multiple Cognitive Services to a single skillset to perform a sequence of AI enrichment steps. Each step or skill can utilize a different Cognitive Service.
Can you change the Cognitive Services account attached to a skillset after it has been created?
Yes, you can change the Cognitive Services account attached to a skillset after it has been created by updating the skillset definition in Azure Search.
Where can you view the usage statistics of the Cognitive Services attached to a skillset?
The usage statistics of the Cognitive Services attached to a skillset can be seen in the Azure portal on the dashboard of the respective Cognitive Service.
What happens if you exceed the quota of your Cognitive Services account while using it with a skillset?
If you exceed the quota of your Cognitive Services account while using it with a skillset, the skillset will fail as it cannot perform the necessary enrichment steps.
Can Cognitive Services attached to a skillset be used concurrently with different data sources?
Yes, a Cognitive Services account can be used concurrently with different data sources by linking it to separate skillsets that are attached to those data sources.
What is the Bing Entity Search API used for in a skillset?
The Bing Entity Search API can be used in a skillset to add rich context for different entities like people, places, or things in your data during the indexing process.
Can a skillset execute without a Cognitive Services account?
A skillset can execute without a Cognitive Services account only if it doesn’t contain any skills that require Cognitive Services, such as Entity Recognition or Sentiment Analysis.
Is there a cost involved for using Cognitive Services with a skillset in Azure Search?
Yes, using Cognitive Services with a skillset incurs additional cost, the specifics of which depend on the Cognitive Services used and activity level.
Can you verify the connection of a Cognitive Services account with a skillset?
Yes, the connection of a Cognitive Services account to a skillset can be verified by checking the skillset details in the Azure Portal or running skillset test API.
Besides the Azure portal, how else can you attach a Cognitive Services account to a skillset?
Besides the Azure portal, you can also attach a Cognitive Services account to a skillset using the Azure CLI, the Azure SDKs, or directly through a REST API call.