Azure Cognitive Services Demo

Video Activity
Join over 3 million cybersecurity professionals advancing their career
Sign up with
Required fields are marked with an *
or

Already have an account? Sign In »

Time
14 hours 28 minutes
Difficulty
Intermediate
CEU/CPE
15
Video Transcription
00:00
>> Hello, Siberians.
00:00
Welcome to Lesson 4.4 of Module 4 of this course,
00:00
titled AZ-301, Microsoft Azure Architect Design.
00:00
This is a very simple lesson,
00:00
as what we'll be covering.
00:00
I'll start by showing
00:00
you how to create an Azure Cognitive Service.
00:00
Then I'm going to show you how to make use of the APIs.
00:00
On this service, we're going to do some tests.
00:00
Let's start with the first task.
00:00
We are going to be creating an Azure Cognitive Service.
00:00
We're going to get an API key
00:00
and it's going to expose it in endpoints.
00:00
Let's ahead to do that.
00:00
Here I'm logged into the Azure portal.
00:00
If I click on "Create a Resource"
00:00
and I type in Cognitive,
00:00
and I have cognitive services there.
00:00
What I'll do is I want to
00:00
create the parent service itself,
00:00
so I select cognitive services and I click on
00:00
"Create". Give it a name.
00:00
I'll call this docognitive01.
00:00
Specify the subscription and the location.
00:00
I'll specify UK South,
00:00
and the pricing tier,
00:00
I'll select the SO, and resource group,
00:00
I previously created a resource group called
00:00
cybary-mod4-ag so I'll select that resource group.
00:00
I'll confirm that I've
00:00
read and understood the notice below,
00:00
which is around data that will be sent to
00:00
Bing Services and Microsoft use of that data.
00:00
Once I've selected that,
00:00
I'll go ahead and click on "Create".
00:00
Ladies and gentlemen, it's as simple as that.
00:00
Surely that's just within a few seconds.
00:00
If I click on Go to Resource there,
00:00
you can see that the service is being created.
00:00
If I click on the Overview,
00:00
you can see my endpoints there,
00:00
and if I click on the Keys,
00:00
you can see the keys that I
00:00
mentioned there. That's looking good.
00:00
Let's move on to the next task.
00:00
In the next task, what I'll be
00:00
doing is I'll be using cURL,
00:00
which is available in the Azure Cloud Shell also.
00:00
What I'll do is I'll be providing
00:00
my Cognitive Service API endpoint
00:00
and the API key using cURL,
00:00
and I'll be making API cURLs to
00:00
the service and our expects to get a response back.
00:00
I'll be showing you two different cases.
00:00
Here's what I'll be showing you.
00:00
I'm going to start first by showing you the Vision API.
00:00
That's an example of how to make
00:00
an HTTP cURL or a vest cURL to that service.
00:00
What I need to do is, number 1,
00:00
I need to replace
00:00
this endpoint URL and
00:00
then I need to put in my subscription key.
00:00
I'll go to copy those three information and
00:00
make them available here in this document.
00:00
If I go under Overview and I copy the endpoint,
00:00
and I paste that in there.
00:00
If I go on the Keys,
00:00
I'll copy my first key,
00:00
and I paste it down there.
00:00
Good. What I'll do is, number 1,
00:00
I'll replace the key here
00:00
and I will also replace the endpoints.
00:00
Let's go to this endpoint,
00:00
and let's make that good. That's looking good.
00:00
What I'm doing is I'm going to be making a cURL to
00:00
this endpoint using my API key,
00:00
which is going to identify my service.
00:00
I'm going to make an endpoint to
00:00
the vision category and
00:00
I'm going to be using this version
00:00
of the API and I'm going to be
00:00
specifying I want to analyze this image.
00:00
If you're looking to get
00:00
more information on what I'm doing here,
00:00
you can always go into Quick starts.
00:00
You have the documentation for
00:00
>> each of the different API.
00:00
>> For example, you can click on
00:00
Computer Vision; analyze images.
00:00
If you scroll down, you can see the API Vision 2.1,
00:00
Vision 2.0, which is what I'm using.
00:00
Then you'll be able to see an example of how to make
00:00
API cURLs using whatever vision that you're using.
00:00
Let's go back to my notepad document.
00:00
What I'm going to be doing is I'm going to be supplying
00:00
an image to the service to the API.
00:00
The image I'm going to be supplying is this image.
00:00
I want it to analyze this image and tell
00:00
me what content exist in it.
00:00
Let's go back to copy that.
00:00
I want to also mention to you that I'm
00:00
piping these into jq,
00:00
which is a JSON formatting through.
00:00
If I do not include jq,
00:00
I would just get a bunch of
00:00
information that's not well formatted,
00:00
so that's why I'm adding jq to that.
00:00
If I go to my Azure Shell to shell.azure.com,
00:00
and I paste the cURL and I press "Enter".
00:00
There we go. It's provided
00:00
a return some information to me.
00:00
It's given me different categories
00:00
for the information that I've supplied.
00:00
Let's move this closer,
00:00
next to one another.
00:00
It's saying it's about 99
00:00
percent confident that it outdoor water.
00:00
That looks accurate.
00:00
It's telling me the description of the tag
00:00
that is going to give to it based on what's detected.
00:00
This is the caption that is going to give to
00:00
it with 91 percent confidence,
00:00
a large waterfall over a rocky cliff.
00:00
That looks about accurate to me.
00:00
The next one that I'll be showing
00:00
>> you is face detection.
00:00
>> Let's modify our API cURL to include
00:00
our endpoints and our subscription key,
00:00
so I'll copy my API key and I'll paste it in there.
00:00
What I'll be doing is I'll supplying an
00:00
>> image and I want
00:00
>> you to analyze the image,
00:00
especially when it comes to face detection.
00:00
Again, you can review the documentation
00:00
on how to make this cURL.
00:00
The image that I'm sending over
00:00
to it is this image right here.
00:00
Let's go back to the Cloud Shell.
00:00
Let's clear the screen.
00:00
I will paste that,
00:00
and I'll press "Enter" to that.
00:00
Let's see where it's detected now.
00:00
For example, let's see,
00:00
it's detected gender as female,
00:00
age to be around 22,
00:00
facial here, zero.
00:00
That looks about right, I will say.
00:00
It's also detected that there's no glasses.
00:00
Happiness about 0.001 percent,
00:00
neutral about 98 percent,
00:00
and sadness about 0.001 percent,
00:00
and surprise also the
00:00
same percentage or similar percentage.
00:00
That looks about right also.
00:00
It's detected things like the makeup,
00:00
eye makeup to be true,
00:00
lip makeup to be true.
00:00
Accessories; no accessories.
00:00
Hair color to be brown,
00:00
and it's confident of that.
00:00
That looks about right.
00:00
It seems like it's done a good job
00:00
of analyzing this image.
00:00
Finally, I'll show you the OCL integration where
00:00
I can extract text or searchable
00:00
>> text from printed text.
00:00
>> I'll be making an API cURL,
00:00
and I'll be sending a printed text.
00:00
That's the text that I'll be sending
00:00
, this one right here.
00:00
It says nothing exists except atoms and empty space,
00:00
everything else is opinion.
00:00
That's just a printed text.
00:00
It could be anything that you're sending away.
00:00
I want to turn this into searchable text.
00:00
What I'm going to be doing and if I go back,
00:00
is I'll send that
00:00
over and I will need to specify my subscription key.
00:00
I think I already have the endpoint correct
00:00
so I just need my subscription key.
00:00
Let's get my subscription key
00:00
>> and now put these in here.
00:00
>> If I copy that,
00:00
if I go over to the Cloud Shell and I clear the screen,
00:00
and if I paste these in there and I press "Enter".
00:00
I know because we're using jq
00:00
to format it as proper JSON,
00:00
it looks all a bit scattered,
00:00
but you can see that it's identifying the text.
00:00
Text equals to nothing,
00:00
text equals to exist,
00:00
text equals to except,
00:00
text equals to atoms.
00:00
You can see that it's detected the text that's here,
00:00
and what we going to do is we going to extract
00:00
these as searchable text.
00:00
That's it for this particular lesson.
00:00
Thanks very much for sticking with
00:00
me as I went through the demo.
00:00
I hope you found it useful and informative.
00:00
I'll see you in the next module.
Up Next