WEBVTT

00:05.140 --> 00:05.740
I have read on.

00:05.740 --> 00:06.650
Welcome back.

00:06.760 --> 00:11.010
So in this final year we're going to be testing the API that we've been developing.

00:11.130 --> 00:13.170
So a couple of things from the previous video.

00:13.180 --> 00:19.050
Basically copied all the files in this file over here and I've moved them into the tutorial once since

00:19.060 --> 00:20.690
we already finished it.

00:20.740 --> 00:26.590
And the reason I did that is because this tutorial one file already has most of the libraries like flask

00:26.590 --> 00:31.810
and stuff like that and flask trustful so we don't have to download them again from scratch but you

00:31.810 --> 00:36.520
can do whatever I do right now and this similar similarity class file.

00:36.520 --> 00:36.760
Right.

00:36.760 --> 00:40.860
So you don't have to copy this into the tutorial one folder.

00:40.870 --> 00:44.220
I just moved it so I don't have the internet connection isn't very good.

00:44.290 --> 00:45.870
So I've just copied it there too.

00:45.870 --> 00:52.720
So that docket composed can cache some of the previously downloaded libraries and instead of downloading

00:52.720 --> 00:55.650
it again from scratch you can just access it from there.

00:55.670 --> 00:58.030
OK so I'm gonna go to tutorial one.

00:58.030 --> 01:01.860
But if you've been following so far then so.

01:01.970 --> 01:06.010
So go back and then go to tutorial one.

01:06.310 --> 01:11.560
And then if you've been following software you can pretend that you're inside text simulator and so

01:11.560 --> 01:14.650
if you open here it is exactly the same file.

01:14.650 --> 01:16.130
Everything's the same.

01:16.180 --> 01:18.630
The ACT-UP why file is the same.

01:18.650 --> 01:22.350
Right so this is what we've been writing registering detect and Riso.

01:22.540 --> 01:27.190
So this API is exactly what you've been writing in the whole file structures to see.

01:27.220 --> 01:30.300
So just pretend that you're indexing of it.

01:30.670 --> 01:35.760
So the first thing we're going to do is to do Sunar Dharker compose built.

01:36.430 --> 01:38.420
So we're going to build the project.

01:38.980 --> 01:43.800
So you'll see that it is going to OK.

01:43.810 --> 01:48.610
So I need to copy first of all this file because it's not excitatory or.

01:48.610 --> 01:51.160
So that's the only thing I haven't copied it yet.

01:51.510 --> 01:56.620
So I'm going to copy this file here that the model that we use in space.

01:56.790 --> 01:57.820
And I'm going to do.

01:57.910 --> 02:04.870
So let's first clear and then we're going to do Sudhakar composed build a gate is going to build them

02:04.870 --> 02:11.130
all I was going to tell me successfully built the model and the next thing I'm going to do is to shoot

02:11.140 --> 02:17.130
her dog her compose up and then I'm going to.

02:17.240 --> 02:21.630
So it should be running now and then you'll see it's running on localhost.

02:21.680 --> 02:22.820
So OK.

02:23.060 --> 02:26.620
So let's now open post man again.

02:29.040 --> 02:36.350
So we're going to open those men and in the meantime let's open the API to see how we expect the input

02:36.350 --> 02:36.710
to be.

02:36.710 --> 02:37.290
OK.

02:37.490 --> 02:42.370
So we come here and I'm going to say pseudo atom here.

02:42.370 --> 02:44.250
So I want to open the atom here.

02:45.310 --> 02:46.070
OK.

02:46.570 --> 02:49.850
So now it has been OK so this is active him over here.

02:49.870 --> 02:51.550
This is our API.

02:51.850 --> 02:53.070
It's at slash.

02:53.080 --> 02:55.120
So let's close this here.

02:55.360 --> 02:57.340
So this is our application.

02:57.340 --> 03:03.460
So the first thing is for the registration right so we go at slash register and it's expecting a username

03:03.460 --> 03:04.180
and password.

03:04.230 --> 03:04.970
OK.

03:05.230 --> 03:09.130
So I'm going to come to post Matt and then I'm going to write.

03:09.180 --> 03:18.280
Let's go to body and lead that and then just go to local hosta 5:7 slash register.

03:18.730 --> 03:28.510
And then from here let's say I have a Jaisalmer that I send a user name as a rule cause of my name and

03:28.600 --> 03:29.940
password.

03:30.220 --> 03:32.890
I'm going to write my password as 2:59 great.

03:32.920 --> 03:34.990
Very very simple password.

03:35.120 --> 03:39.260
And so I'm going to send this to so that I can register in the AP.

03:39.260 --> 03:41.630
I'm going to send this.

03:41.820 --> 03:48.150
And then there is the response status 202 I successfully signed up for the right for the message you

03:48.150 --> 03:50.280
successfully signed up for the API.

03:50.490 --> 03:50.880
Great.

03:50.880 --> 03:53.460
So now I have registered for the API.

03:53.670 --> 03:56.180
So now I'm going to be comparing.

03:56.190 --> 04:02.790
So if I go to the second thing is detect right and detect expects a username password.

04:02.790 --> 04:04.220
Text 1 and text 2.

04:04.320 --> 04:05.090
OK.

04:05.400 --> 04:10.220
So when I go back to postman and then I'm going to write karma.

04:10.350 --> 04:12.400
So I have a user name and my password.

04:12.510 --> 04:14.800
But this time I'm going to give it the next one.

04:14.910 --> 04:19.690
As for example this is a cute dog.

04:19.940 --> 04:20.580
OK.

04:22.470 --> 04:29.060
And then free text do I'm going to write Wow what a cute dog.

04:29.100 --> 04:29.650
OK.

04:29.850 --> 04:31.060
So they're very similar right.

04:31.070 --> 04:37.370
They're saying or for example I can write the dog is so cute.

04:37.410 --> 04:38.160
OK.

04:38.400 --> 04:40.370
So I'm saying one this is a cute dog.

04:40.380 --> 04:43.990
And wow the dog is so cute and it's funny.

04:44.220 --> 04:48.850
And that is going to tell me how close these two techs are or how similar they are.

04:48.850 --> 04:52.350
So police should give us a relatively high number.

04:52.350 --> 04:58.180
Right so not exactly one because there are different sentences obviously but they're also very similar.

04:58.170 --> 04:58.410
Right.

04:58.420 --> 05:00.230
They relate to each other.

05:00.540 --> 05:08.410
OK so let's try to use the service or send text and it tells me it's an invalid username.

05:08.570 --> 05:09.960
That's interesting.

05:10.330 --> 05:11.150
OK I see.

05:11.150 --> 05:13.500
So we haven't changed flash registers.

05:13.550 --> 05:15.550
This should be slashed tact.

05:15.740 --> 05:16.380
OK.

05:16.520 --> 05:18.370
So not register.

05:18.470 --> 05:23.130
So that's why it's telling me an invalid username because my user name is already taken.

05:23.130 --> 05:24.660
So he tells me choose another one.

05:24.740 --> 05:31.260
But we want to detect and not involve user ID and not register.

05:31.290 --> 05:32.770
OK so we're going to send this again.

05:32.780 --> 05:34.320
This is on file again.

05:34.580 --> 05:36.820
And then your notice here that it tells me.

05:36.850 --> 05:38.800
Let's see if I can make it bigger.

05:38.810 --> 05:40.070
Not quite.

05:40.340 --> 05:40.880
Exactly.

05:40.880 --> 05:48.140
Postman you would notice here tells me similarity score calculator successfully ratio is 0.66 5.

05:48.290 --> 05:51.010
So it's close to one race not super far away.

05:51.080 --> 05:55.630
So you can think of it as this is sixty six point five percent.

05:55.910 --> 05:56.360
Similar.

05:56.360 --> 06:00.950
So these two sentences are sixty six point five percent similar and that's fair enough.

06:00.950 --> 06:01.930
Right.

06:02.000 --> 06:06.790
They're talking about the same thing but not necessarily in the same format right.

06:06.800 --> 06:11.930
So this is the similarity between them and then status is still on.

06:11.960 --> 06:14.510
So what about if we change for example you too.

06:14.510 --> 06:15.350
Beautiful.

06:15.410 --> 06:16.330
Beautiful.

06:16.430 --> 06:16.940
OK.

06:17.120 --> 06:20.330
With that be changed the score obviously too good.

06:20.390 --> 06:23.050
So now it's sixty two point two percent.

06:23.330 --> 06:29.720
But you can still see that even though I changed it from cute to beautiful it still knows the similarity.

06:29.720 --> 06:29.870
Right.

06:29.870 --> 06:32.420
And this is the power of natural language processing.

06:32.450 --> 06:33.090
Right.

06:33.110 --> 06:37.840
It's able to do find that these two sentences are similar even though I don't.

06:37.940 --> 06:43.260
So I only have this dog right dog here that is that are exactly the same.

06:43.280 --> 06:48.810
But the sentences are two different sentences but it still finds the similarity is 62 percent.

06:48.830 --> 06:50.580
And that's pretty pretty cool.

06:50.590 --> 06:51.750
Right.

06:52.550 --> 06:55.460
OK so what happens if I keep abusing the system right.

06:55.520 --> 06:57.020
I use all my six tokens.

06:57.020 --> 07:03.450
I want to keep sending requests keep sending requests keeps running until I run out of tokens.

07:03.500 --> 07:05.930
So you can test the last gig.

07:06.140 --> 07:07.170
Oh yeah.

07:07.340 --> 07:09.550
So it says message you're out of tokens.

07:09.550 --> 07:12.300
Please refill status three or three.

07:12.440 --> 07:13.920
OK so that's the air.

07:14.270 --> 07:22.160
Now I need to refill so I'm going on right refill and then username my username so let's let me just

07:22.190 --> 07:24.080
copy this before I believe it.

07:24.080 --> 07:34.200
So I'm going I write user name is Faruq admin password is ABC 1 2 3 right ABC 1 2 3.

07:34.630 --> 07:41.710
And we're going to do the next one in-text do and we're gonna give it the refill amount.

07:41.710 --> 07:49.350
So I'm going to write refill and then for example for someone to give myself were tokens OK.

07:49.690 --> 07:50.790
So let's meet let's.

07:50.810 --> 07:57.310
And that last refill sells refilled successfully status 200.

07:57.310 --> 08:06.340
Now if I try to access the API again so I'm going to write the same to slash deduct the same Jason File

08:06.340 --> 08:12.000
to detect and I said that then it tells me a similarity score calculator.

08:12.010 --> 08:14.020
So now I have three tokens left.

08:14.160 --> 08:17.990
Now I can actually change this and I can write for example.

08:18.670 --> 08:21.200
Same sentence.

08:21.610 --> 08:26.780
And then here I would write also same sentence.

08:26.950 --> 08:32.050
And then it should be very very close to what rights are because they're exactly the same sentences.

08:32.050 --> 08:35.880
So if I send them then you would notice here that the ratio is one.

08:35.920 --> 08:36.730
Exactly.

08:36.730 --> 08:39.860
So these sentences are exactly identical.

08:40.880 --> 08:49.990
So yeah this is basically the entire API has three three ends or hit points register detect refill.

08:49.990 --> 08:54.830
We've tested it and it works fine and everything's working cool.

08:54.890 --> 08:58.670
So yeah we're going to stop here and I'll see you in the next video.

08:58.670 --> 09:00.840
So until the next video the.
