title
stringlengths
12
112
published
stringlengths
19
23
url
stringlengths
28
28
video_id
stringlengths
11
11
channel_id
stringclasses
5 values
id
stringlengths
16
31
text
stringlengths
0
596
start
float64
0
37.8k
end
float64
2.18
37.8k
API Series #3 - How to Deploy Flask APIs to the Cloud (GCP)
2021-11-02 14:30:00 UTC
https://youtu.be/3fsIcMgUOY8
3fsIcMgUOY8
UCv83tO5cePwHMt1952IVVHw
3fsIcMgUOY8-t606.08
11.
606.08
613.04
API Series #3 - How to Deploy Flask APIs to the Cloud (GCP)
2021-11-02 14:30:00 UTC
https://youtu.be/3fsIcMgUOY8
3fsIcMgUOY8
UCv83tO5cePwHMt1952IVVHw
3fsIcMgUOY8-t610.64
Okay, this is actually quite useful.
610.64
619.68
API Series #3 - How to Deploy Flask APIs to the Cloud (GCP)
2021-11-02 14:30:00 UTC
https://youtu.be/3fsIcMgUOY8
3fsIcMgUOY8
UCv83tO5cePwHMt1952IVVHw
3fsIcMgUOY8-t613.0400000000001
So I've got this error that's popped up because I am currently in another project,
613.04
620.88
API Series #3 - How to Deploy Flask APIs to the Cloud (GCP)
2021-11-02 14:30:00 UTC
https://youtu.be/3fsIcMgUOY8
3fsIcMgUOY8
UCv83tO5cePwHMt1952IVVHw
3fsIcMgUOY8-t619.6800000000001
which no longer exists.
619.68
622.48
API Series #3 - How to Deploy Flask APIs to the Cloud (GCP)
2021-11-02 14:30:00 UTC
https://youtu.be/3fsIcMgUOY8
3fsIcMgUOY8
UCv83tO5cePwHMt1952IVVHw
3fsIcMgUOY8-t620.88
So I'm getting this error.
620.88
627.68
API Series #3 - How to Deploy Flask APIs to the Cloud (GCP)
2021-11-02 14:30:00 UTC
https://youtu.be/3fsIcMgUOY8
3fsIcMgUOY8
UCv83tO5cePwHMt1952IVVHw
3fsIcMgUOY8-t622.48
So I need to make sure that I'm trying to deploy to the right project.
622.48
630.16
API Series #3 - How to Deploy Flask APIs to the Cloud (GCP)
2021-11-02 14:30:00 UTC
https://youtu.be/3fsIcMgUOY8
3fsIcMgUOY8
UCv83tO5cePwHMt1952IVVHw
3fsIcMgUOY8-t627.6800000000001
So I just write gcloud app deploy.
627.68
633.92
API Series #3 - How to Deploy Flask APIs to the Cloud (GCP)
2021-11-02 14:30:00 UTC
https://youtu.be/3fsIcMgUOY8
3fsIcMgUOY8
UCv83tO5cePwHMt1952IVVHw
3fsIcMgUOY8-t632.0
I can specify the app.yaml.
632
637.12
API Series #3 - How to Deploy Flask APIs to the Cloud (GCP)
2021-11-02 14:30:00 UTC
https://youtu.be/3fsIcMgUOY8
3fsIcMgUOY8
UCv83tO5cePwHMt1952IVVHw
3fsIcMgUOY8-t633.92
And I just write project equals.
633.92
640.16
API Series #3 - How to Deploy Flask APIs to the Cloud (GCP)
2021-11-02 14:30:00 UTC
https://youtu.be/3fsIcMgUOY8
3fsIcMgUOY8
UCv83tO5cePwHMt1952IVVHw
3fsIcMgUOY8-t637.12
And then in here, I need the project name from before.
637.12
642.16
API Series #3 - How to Deploy Flask APIs to the Cloud (GCP)
2021-11-02 14:30:00 UTC
https://youtu.be/3fsIcMgUOY8
3fsIcMgUOY8
UCv83tO5cePwHMt1952IVVHw
3fsIcMgUOY8-t640.16
So I'm just going to go and copy that again.
640.16
645.76
API Series #3 - How to Deploy Flask APIs to the Cloud (GCP)
2021-11-02 14:30:00 UTC
https://youtu.be/3fsIcMgUOY8
3fsIcMgUOY8
UCv83tO5cePwHMt1952IVVHw
3fsIcMgUOY8-t644.8
So come to here.
644.8
652.96
API Series #3 - How to Deploy Flask APIs to the Cloud (GCP)
2021-11-02 14:30:00 UTC
https://youtu.be/3fsIcMgUOY8
3fsIcMgUOY8
UCv83tO5cePwHMt1952IVVHw
3fsIcMgUOY8-t651.1999999999999
So it's this abstract ring.
651.2
659.12
API Series #3 - How to Deploy Flask APIs to the Cloud (GCP)
2021-11-02 14:30:00 UTC
https://youtu.be/3fsIcMgUOY8
3fsIcMgUOY8
UCv83tO5cePwHMt1952IVVHw
3fsIcMgUOY8-t652.96
Abstract ring.
652.96
665.36
API Series #3 - How to Deploy Flask APIs to the Cloud (GCP)
2021-11-02 14:30:00 UTC
https://youtu.be/3fsIcMgUOY8
3fsIcMgUOY8
UCv83tO5cePwHMt1952IVVHw
3fsIcMgUOY8-t662.32
And I just write in here abstract ring.
662.32
666.64
API Series #3 - How to Deploy Flask APIs to the Cloud (GCP)
2021-11-02 14:30:00 UTC
https://youtu.be/3fsIcMgUOY8
3fsIcMgUOY8
UCv83tO5cePwHMt1952IVVHw
3fsIcMgUOY8-t666.4000000000001
Okay.
666.4
668.72
API Series #3 - How to Deploy Flask APIs to the Cloud (GCP)
2021-11-02 14:30:00 UTC
https://youtu.be/3fsIcMgUOY8
3fsIcMgUOY8
UCv83tO5cePwHMt1952IVVHw
3fsIcMgUOY8-t667.2800000000001
Now run that.
667.28
671.6
API Series #3 - How to Deploy Flask APIs to the Cloud (GCP)
2021-11-02 14:30:00 UTC
https://youtu.be/3fsIcMgUOY8
3fsIcMgUOY8
UCv83tO5cePwHMt1952IVVHw
3fsIcMgUOY8-t668.72
That should come up with this here.
668.72
675.52
API Series #3 - How to Deploy Flask APIs to the Cloud (GCP)
2021-11-02 14:30:00 UTC
https://youtu.be/3fsIcMgUOY8
3fsIcMgUOY8
UCv83tO5cePwHMt1952IVVHw
3fsIcMgUOY8-t672.24
So we have come down here.
672.24
678.88
API Series #3 - How to Deploy Flask APIs to the Cloud (GCP)
2021-11-02 14:30:00 UTC
https://youtu.be/3fsIcMgUOY8
3fsIcMgUOY8
UCv83tO5cePwHMt1952IVVHw
3fsIcMgUOY8-t675.52
We have the script and then the target project.
675.52
679.6
API Series #3 - How to Deploy Flask APIs to the Cloud (GCP)
2021-11-02 14:30:00 UTC
https://youtu.be/3fsIcMgUOY8
3fsIcMgUOY8
UCv83tO5cePwHMt1952IVVHw
3fsIcMgUOY8-t678.88
So it's correct.
678.88
682.96
API Series #3 - How to Deploy Flask APIs to the Cloud (GCP)
2021-11-02 14:30:00 UTC
https://youtu.be/3fsIcMgUOY8
3fsIcMgUOY8
UCv83tO5cePwHMt1952IVVHw
3fsIcMgUOY8-t679.6
We're now going to the correct place.
679.6
687.36
API Series #3 - How to Deploy Flask APIs to the Cloud (GCP)
2021-11-02 14:30:00 UTC
https://youtu.be/3fsIcMgUOY8
3fsIcMgUOY8
UCv83tO5cePwHMt1952IVVHw
3fsIcMgUOY8-t682.96
And this URL here is where we will be deploying the API to.
682.96
689.84
API Series #3 - How to Deploy Flask APIs to the Cloud (GCP)
2021-11-02 14:30:00 UTC
https://youtu.be/3fsIcMgUOY8
3fsIcMgUOY8
UCv83tO5cePwHMt1952IVVHw
3fsIcMgUOY8-t688.16
So I'm going to click continue.
688.16
690.16
API Series #3 - How to Deploy Flask APIs to the Cloud (GCP)
2021-11-02 14:30:00 UTC
https://youtu.be/3fsIcMgUOY8
3fsIcMgUOY8
UCv83tO5cePwHMt1952IVVHw
3fsIcMgUOY8-t689.84
Yes.
689.84
696.24
API Series #3 - How to Deploy Flask APIs to the Cloud (GCP)
2021-11-02 14:30:00 UTC
https://youtu.be/3fsIcMgUOY8
3fsIcMgUOY8
UCv83tO5cePwHMt1952IVVHw
3fsIcMgUOY8-t691.84
And this can take a little bit of time for it to run.
691.84
699.12
API Series #3 - How to Deploy Flask APIs to the Cloud (GCP)
2021-11-02 14:30:00 UTC
https://youtu.be/3fsIcMgUOY8
3fsIcMgUOY8
UCv83tO5cePwHMt1952IVVHw
3fsIcMgUOY8-t697.36
So just wait a moment.
697.36
705.36
API Series #3 - How to Deploy Flask APIs to the Cloud (GCP)
2021-11-02 14:30:00 UTC
https://youtu.be/3fsIcMgUOY8
3fsIcMgUOY8
UCv83tO5cePwHMt1952IVVHw
3fsIcMgUOY8-t700.48
One thing that's actually pretty useful is when you try,
700.48
709.92
API Series #3 - How to Deploy Flask APIs to the Cloud (GCP)
2021-11-02 14:30:00 UTC
https://youtu.be/3fsIcMgUOY8
3fsIcMgUOY8
UCv83tO5cePwHMt1952IVVHw
3fsIcMgUOY8-t705.36
when you first deploy, gcloud will create this gcloud ignore file.
705.36
711.12
API Series #3 - How to Deploy Flask APIs to the Cloud (GCP)
2021-11-02 14:30:00 UTC
https://youtu.be/3fsIcMgUOY8
3fsIcMgUOY8
UCv83tO5cePwHMt1952IVVHw
3fsIcMgUOY8-t709.92
It's like a git ignore.
709.92
718.8
API Series #3 - How to Deploy Flask APIs to the Cloud (GCP)
2021-11-02 14:30:00 UTC
https://youtu.be/3fsIcMgUOY8
3fsIcMgUOY8
UCv83tO5cePwHMt1952IVVHw
3fsIcMgUOY8-t712.4
And in here, it will just ignore the typical things that you do actually want to ignore.
712.4
722.16
API Series #3 - How to Deploy Flask APIs to the Cloud (GCP)
2021-11-02 14:30:00 UTC
https://youtu.be/3fsIcMgUOY8
3fsIcMgUOY8
UCv83tO5cePwHMt1952IVVHw
3fsIcMgUOY8-t719.36
So you have PyCache here, which has been created up here.
719.36
728.4
API Series #3 - How to Deploy Flask APIs to the Cloud (GCP)
2021-11-02 14:30:00 UTC
https://youtu.be/3fsIcMgUOY8
3fsIcMgUOY8
UCv83tO5cePwHMt1952IVVHw
3fsIcMgUOY8-t722.16
So we don't need to exclude that from the upload by default, which is useful, I think.
722.16
732.96
API Series #3 - How to Deploy Flask APIs to the Cloud (GCP)
2021-11-02 14:30:00 UTC
https://youtu.be/3fsIcMgUOY8
3fsIcMgUOY8
UCv83tO5cePwHMt1952IVVHw
3fsIcMgUOY8-t729.76
So see how that is going.
729.76
734.08
API Series #3 - How to Deploy Flask APIs to the Cloud (GCP)
2021-11-02 14:30:00 UTC
https://youtu.be/3fsIcMgUOY8
3fsIcMgUOY8
UCv83tO5cePwHMt1952IVVHw
3fsIcMgUOY8-t732.96
Still uploading.
732.96
735.6
API Series #3 - How to Deploy Flask APIs to the Cloud (GCP)
2021-11-02 14:30:00 UTC
https://youtu.be/3fsIcMgUOY8
3fsIcMgUOY8
UCv83tO5cePwHMt1952IVVHw
3fsIcMgUOY8-t734.08
Still uploading.
734.08
737.52
API Series #3 - How to Deploy Flask APIs to the Cloud (GCP)
2021-11-02 14:30:00 UTC
https://youtu.be/3fsIcMgUOY8
3fsIcMgUOY8
UCv83tO5cePwHMt1952IVVHw
3fsIcMgUOY8-t736.72
Okay.
736.72
740.08
API Series #3 - How to Deploy Flask APIs to the Cloud (GCP)
2021-11-02 14:30:00 UTC
https://youtu.be/3fsIcMgUOY8
3fsIcMgUOY8
UCv83tO5cePwHMt1952IVVHw
3fsIcMgUOY8-t737.5200000000001
So good to go.
737.52
741.92
API Series #3 - How to Deploy Flask APIs to the Cloud (GCP)
2021-11-02 14:30:00 UTC
https://youtu.be/3fsIcMgUOY8
3fsIcMgUOY8
UCv83tO5cePwHMt1952IVVHw
3fsIcMgUOY8-t741.0400000000001
I'm going to copy this.
741.04
745.36
API Series #3 - How to Deploy Flask APIs to the Cloud (GCP)
2021-11-02 14:30:00 UTC
https://youtu.be/3fsIcMgUOY8
3fsIcMgUOY8
UCv83tO5cePwHMt1952IVVHw
3fsIcMgUOY8-t744.4000000000001
Open in the browser.
744.4
752.56
API Series #3 - How to Deploy Flask APIs to the Cloud (GCP)
2021-11-02 14:30:00 UTC
https://youtu.be/3fsIcMgUOY8
3fsIcMgUOY8
UCv83tO5cePwHMt1952IVVHw
3fsIcMgUOY8-t747.5200000000001
And we should see, so what we saw before with this, we should end up seeing the same.
747.52
756
API Series #3 - How to Deploy Flask APIs to the Cloud (GCP)
2021-11-02 14:30:00 UTC
https://youtu.be/3fsIcMgUOY8
3fsIcMgUOY8
UCv83tO5cePwHMt1952IVVHw
3fsIcMgUOY8-t752.5600000000001
So we'll go first to that address.
752.56
758.64
API Series #3 - How to Deploy Flask APIs to the Cloud (GCP)
2021-11-02 14:30:00 UTC
https://youtu.be/3fsIcMgUOY8
3fsIcMgUOY8
UCv83tO5cePwHMt1952IVVHw
3fsIcMgUOY8-t758.4000000000001
Okay.
758.4
760.72
API Series #3 - How to Deploy Flask APIs to the Cloud (GCP)
2021-11-02 14:30:00 UTC
https://youtu.be/3fsIcMgUOY8
3fsIcMgUOY8
UCv83tO5cePwHMt1952IVVHw
3fsIcMgUOY8-t758.6400000000001
We get that not found that we saw before.
758.64
763.04
API Series #3 - How to Deploy Flask APIs to the Cloud (GCP)
2021-11-02 14:30:00 UTC
https://youtu.be/3fsIcMgUOY8
3fsIcMgUOY8
UCv83tO5cePwHMt1952IVVHw
3fsIcMgUOY8-t760.72
So expected.
760.72
764.4
API Series #3 - How to Deploy Flask APIs to the Cloud (GCP)
2021-11-02 14:30:00 UTC
https://youtu.be/3fsIcMgUOY8
3fsIcMgUOY8
UCv83tO5cePwHMt1952IVVHw
3fsIcMgUOY8-t763.04
And we'll just go to users.
763.04
767.6
API Series #3 - How to Deploy Flask APIs to the Cloud (GCP)
2021-11-02 14:30:00 UTC
https://youtu.be/3fsIcMgUOY8
3fsIcMgUOY8
UCv83tO5cePwHMt1952IVVHw
3fsIcMgUOY8-t767.04
There we go.
767.04
769.44
API Series #3 - How to Deploy Flask APIs to the Cloud (GCP)
2021-11-02 14:30:00 UTC
https://youtu.be/3fsIcMgUOY8
3fsIcMgUOY8
UCv83tO5cePwHMt1952IVVHw
3fsIcMgUOY8-t769.04
Okay.
769.04
775.6
API Series #3 - How to Deploy Flask APIs to the Cloud (GCP)
2021-11-02 14:30:00 UTC
https://youtu.be/3fsIcMgUOY8
3fsIcMgUOY8
UCv83tO5cePwHMt1952IVVHw
3fsIcMgUOY8-t769.4399999999999
So we see that our API is now deployed to Google Cloud.
769.44
777.44
API Series #3 - How to Deploy Flask APIs to the Cloud (GCP)
2021-11-02 14:30:00 UTC
https://youtu.be/3fsIcMgUOY8
3fsIcMgUOY8
UCv83tO5cePwHMt1952IVVHw
3fsIcMgUOY8-t775.5999999999999
I can also see that over here.
775.6
785.2
API Series #3 - How to Deploy Flask APIs to the Cloud (GCP)
2021-11-02 14:30:00 UTC
https://youtu.be/3fsIcMgUOY8
3fsIcMgUOY8
UCv83tO5cePwHMt1952IVVHw
3fsIcMgUOY8-t777.4399999999999
So if I refresh, we should see the request pop up over here.
777.44
788.16
API Series #3 - How to Deploy Flask APIs to the Cloud (GCP)
2021-11-02 14:30:00 UTC
https://youtu.be/3fsIcMgUOY8
3fsIcMgUOY8
UCv83tO5cePwHMt1952IVVHw
3fsIcMgUOY8-t786.64
Or they will do eventually.
786.64
792.88
API Series #3 - How to Deploy Flask APIs to the Cloud (GCP)
2021-11-02 14:30:00 UTC
https://youtu.be/3fsIcMgUOY8
3fsIcMgUOY8
UCv83tO5cePwHMt1952IVVHw
3fsIcMgUOY8-t788.16
So this will give you a summary of how many requests are made to your API.
788.16
794.56
API Series #3 - How to Deploy Flask APIs to the Cloud (GCP)
2021-11-02 14:30:00 UTC
https://youtu.be/3fsIcMgUOY8
3fsIcMgUOY8
UCv83tO5cePwHMt1952IVVHw
3fsIcMgUOY8-t792.88
That's it for this video.
792.88
798.24
API Series #3 - How to Deploy Flask APIs to the Cloud (GCP)
2021-11-02 14:30:00 UTC
https://youtu.be/3fsIcMgUOY8
3fsIcMgUOY8
UCv83tO5cePwHMt1952IVVHw
3fsIcMgUOY8-t795.4399999999999
I hope it's been useful.
795.44
801.44
API Series #3 - How to Deploy Flask APIs to the Cloud (GCP)
2021-11-02 14:30:00 UTC
https://youtu.be/3fsIcMgUOY8
3fsIcMgUOY8
UCv83tO5cePwHMt1952IVVHw
3fsIcMgUOY8-t799.1999999999999
And I will see you in the next one.
799.2
819.44
API Series #3 - How to Deploy Flask APIs to the Cloud (GCP)
2021-11-02 14:30:00 UTC
https://youtu.be/3fsIcMgUOY8
3fsIcMgUOY8
UCv83tO5cePwHMt1952IVVHw
3fsIcMgUOY8-t801.44
801.44
819.44
Training BERT #3 - Next Sentence Prediction (NSP)
2021-05-25 14:56:47 UTC
https://youtu.be/1gN1snKBLP0
1gN1snKBLP0
UCv83tO5cePwHMt1952IVVHw
1gN1snKBLP0-t0.0
Hi, welcome to the video. Here we're going to have a look at using next sentence prediction or NSP
0
14.4
Training BERT #3 - Next Sentence Prediction (NSP)
2021-05-25 14:56:47 UTC
https://youtu.be/1gN1snKBLP0
1gN1snKBLP0
UCv83tO5cePwHMt1952IVVHw
1gN1snKBLP0-t6.8
for fine tuning our BERT models. Now a few of the previous videos we covered mass language modeling
6.8
21.68
Training BERT #3 - Next Sentence Prediction (NSP)
2021-05-25 14:56:47 UTC
https://youtu.be/1gN1snKBLP0
1gN1snKBLP0
UCv83tO5cePwHMt1952IVVHw
1gN1snKBLP0-t14.4
and how we use mass language modeling to fine tune our models. NSP is like the other half of fine
14.4
29.92
Training BERT #3 - Next Sentence Prediction (NSP)
2021-05-25 14:56:47 UTC
https://youtu.be/1gN1snKBLP0
1gN1snKBLP0
UCv83tO5cePwHMt1952IVVHw
1gN1snKBLP0-t21.68
tuning for BERT. So both of those techniques during the actual training of BERT, so when Google train
21.68
38.96
Training BERT #3 - Next Sentence Prediction (NSP)
2021-05-25 14:56:47 UTC
https://youtu.be/1gN1snKBLP0
1gN1snKBLP0
UCv83tO5cePwHMt1952IVVHw
1gN1snKBLP0-t29.92
BERT initially, they use both of these methods and whereas MLM is identifying or almost training on
29.92
46.88
Training BERT #3 - Next Sentence Prediction (NSP)
2021-05-25 14:56:47 UTC
https://youtu.be/1gN1snKBLP0
1gN1snKBLP0
UCv83tO5cePwHMt1952IVVHw
1gN1snKBLP0-t38.96
the relationships between words, next sentence prediction is training on more long-term relationships
38.96
56
Training BERT #3 - Next Sentence Prediction (NSP)
2021-05-25 14:56:47 UTC
https://youtu.be/1gN1snKBLP0
1gN1snKBLP0
UCv83tO5cePwHMt1952IVVHw
1gN1snKBLP0-t46.88
between sentences rather than words. And in the original BERT paper it was found that without
46.88
62.72
Training BERT #3 - Next Sentence Prediction (NSP)
2021-05-25 14:56:47 UTC
https://youtu.be/1gN1snKBLP0
1gN1snKBLP0
UCv83tO5cePwHMt1952IVVHw
1gN1snKBLP0-t56.0
NSP because they tried training BERT without NSP as well, BERT performed worse on every single metric.
56
69.2
Training BERT #3 - Next Sentence Prediction (NSP)
2021-05-25 14:56:47 UTC
https://youtu.be/1gN1snKBLP0
1gN1snKBLP0
UCv83tO5cePwHMt1952IVVHw
1gN1snKBLP0-t62.72
So it is pretty important and obviously if we take this approach, we take mass language modeling and
62.72
76.32
Training BERT #3 - Next Sentence Prediction (NSP)
2021-05-25 14:56:47 UTC
https://youtu.be/1gN1snKBLP0
1gN1snKBLP0
UCv83tO5cePwHMt1952IVVHw
1gN1snKBLP0-t69.2
NSP and apply both those to training our models, fine tuning our models, we're going to get better
69.2
85.76
Training BERT #3 - Next Sentence Prediction (NSP)
2021-05-25 14:56:47 UTC
https://youtu.be/1gN1snKBLP0
1gN1snKBLP0
UCv83tO5cePwHMt1952IVVHw
1gN1snKBLP0-t76.32
results and if we just use MLM. So what is NSP? NSP consists of giving BERT two sentences, sentence
76.32
93.04
Training BERT #3 - Next Sentence Prediction (NSP)
2021-05-25 14:56:47 UTC
https://youtu.be/1gN1snKBLP0
1gN1snKBLP0
UCv83tO5cePwHMt1952IVVHw
1gN1snKBLP0-t85.76
A and sentence B and saying paper does sentence B come after sentence A and then BERT will say okay
85.76
101.44
Training BERT #3 - Next Sentence Prediction (NSP)
2021-05-25 14:56:47 UTC
https://youtu.be/1gN1snKBLP0
1gN1snKBLP0
UCv83tO5cePwHMt1952IVVHw
1gN1snKBLP0-t94.4
sentence B is the next sentence after sentence A or it is not the next sentence after the sentence
94.4
110.32
Training BERT #3 - Next Sentence Prediction (NSP)
2021-05-25 14:56:47 UTC
https://youtu.be/1gN1snKBLP0
1gN1snKBLP0
UCv83tO5cePwHMt1952IVVHw
1gN1snKBLP0-t101.44
A. So if we took these three sentences that are on the screen, we have one, two and three, right?
101.44
118.64
Training BERT #3 - Next Sentence Prediction (NSP)
2021-05-25 14:56:47 UTC
https://youtu.be/1gN1snKBLP0
1gN1snKBLP0
UCv83tO5cePwHMt1952IVVHw
1gN1snKBLP0-t110.32
One and two, if you ask BERT does sentence two come after sentence one, then we'd kind of want BERT to
110.32
125.68
Training BERT #3 - Next Sentence Prediction (NSP)
2021-05-25 14:56:47 UTC
https://youtu.be/1gN1snKBLP0
1gN1snKBLP0
UCv83tO5cePwHMt1952IVVHw
1gN1snKBLP0-t118.63999999999999
say no, right? Because clearly they're talking about completely different topics and the type
118.64
130.4
Training BERT #3 - Next Sentence Prediction (NSP)
2021-05-25 14:56:47 UTC
https://youtu.be/1gN1snKBLP0
1gN1snKBLP0
UCv83tO5cePwHMt1952IVVHw
1gN1snKBLP0-t125.67999999999999
of language and everything in there just doesn't really match up. But then if we have a look at
125.68
139.04
Training BERT #3 - Next Sentence Prediction (NSP)
2021-05-25 14:56:47 UTC
https://youtu.be/1gN1snKBLP0
1gN1snKBLP0
UCv83tO5cePwHMt1952IVVHw
1gN1snKBLP0-t130.4
sentence three and sentence one, they do match up. So sentence three is quite possibly a
130.4
148.08
Training BERT #3 - Next Sentence Prediction (NSP)
2021-05-25 14:56:47 UTC
https://youtu.be/1gN1snKBLP0
1gN1snKBLP0
UCv83tO5cePwHMt1952IVVHw
1gN1snKBLP0-t139.04
the follow-on sentence after sentence one. So in that case we would expect BERT to say this is the
139.04
158.88
Training BERT #3 - Next Sentence Prediction (NSP)
2021-05-25 14:56:47 UTC
https://youtu.be/1gN1snKBLP0
1gN1snKBLP0
UCv83tO5cePwHMt1952IVVHw
1gN1snKBLP0-t148.07999999999998
next sentence. So let's have a look at how NSP looks within BERT itself. So here we have the core
148.08
171.2
Training BERT #3 - Next Sentence Prediction (NSP)
2021-05-25 14:56:47 UTC
https://youtu.be/1gN1snKBLP0
1gN1snKBLP0
UCv83tO5cePwHMt1952IVVHw
1gN1snKBLP0-t158.88
BERT model and during fine-tuning or pre-training we add this other head on top of BERT. So this is the BERT for pre-training head.
158.88
177.44
Training BERT #3 - Next Sentence Prediction (NSP)
2021-05-25 14:56:47 UTC
https://youtu.be/1gN1snKBLP0
1gN1snKBLP0
UCv83tO5cePwHMt1952IVVHw
1gN1snKBLP0-t172.0
And the BERT for pre-training head contains two different heads inside it.
172
184.64
Training BERT #3 - Next Sentence Prediction (NSP)
2021-05-25 14:56:47 UTC
https://youtu.be/1gN1snKBLP0
1gN1snKBLP0
UCv83tO5cePwHMt1952IVVHw
1gN1snKBLP0-t180.48
And that is our NSP head and our mass language modeling head.
180.48
193.68
Training BERT #3 - Next Sentence Prediction (NSP)
2021-05-25 14:56:47 UTC
https://youtu.be/1gN1snKBLP0
1gN1snKBLP0
UCv83tO5cePwHMt1952IVVHw
1gN1snKBLP0-t184.64
Now we just want to focus on the NSP head for now. And as well we don't need to fine-tune or
184.64
198.88
Training BERT #3 - Next Sentence Prediction (NSP)
2021-05-25 14:56:47 UTC
https://youtu.be/1gN1snKBLP0
1gN1snKBLP0
UCv83tO5cePwHMt1952IVVHw
1gN1snKBLP0-t193.67999999999998
train our models with both of these heads. We can actually do it one by one. We could use it mass
193.68
206.8
Training BERT #3 - Next Sentence Prediction (NSP)
2021-05-25 14:56:47 UTC
https://youtu.be/1gN1snKBLP0
1gN1snKBLP0
UCv83tO5cePwHMt1952IVVHw
1gN1snKBLP0-t198.88
language modeling only or we could use NSP only. But the full approach to pre-training BERT is using both.
198.88
213.2
Training BERT #3 - Next Sentence Prediction (NSP)
2021-05-25 14:56:47 UTC
https://youtu.be/1gN1snKBLP0
1gN1snKBLP0
UCv83tO5cePwHMt1952IVVHw
1gN1snKBLP0-t206.8
So if we have a look inside our NSP head we'll find that we have a feed forward neural network
206.8
223.92
Training BERT #3 - Next Sentence Prediction (NSP)
2021-05-25 14:56:47 UTC
https://youtu.be/1gN1snKBLP0
1gN1snKBLP0
UCv83tO5cePwHMt1952IVVHw
1gN1snKBLP0-t213.92000000000002
and that will output two different values. Now these two values are our is not the next sequence
213.92
236.56
Training BERT #3 - Next Sentence Prediction (NSP)
2021-05-25 14:56:47 UTC
https://youtu.be/1gN1snKBLP0
1gN1snKBLP0
UCv83tO5cePwHMt1952IVVHw
1gN1snKBLP0-t223.92
there and our is the next sequence which is there. Okay so value zero is the next sentence value one is not the next sentence.
223.92
245.92
Training BERT #3 - Next Sentence Prediction (NSP)
2021-05-25 14:56:47 UTC
https://youtu.be/1gN1snKBLP0
1gN1snKBLP0
UCv83tO5cePwHMt1952IVVHw
1gN1snKBLP0-t238.56
Now we have the final outputs from our final encoder in BERT at the bottom here.
238.56
256
Training BERT #3 - Next Sentence Prediction (NSP)
2021-05-25 14:56:47 UTC
https://youtu.be/1gN1snKBLP0
1gN1snKBLP0
UCv83tO5cePwHMt1952IVVHw
1gN1snKBLP0-t245.92
And we don't actually use all of these activations. We only use the CLS token activation which is over at the left here.
245.92
265.68
Training BERT #3 - Next Sentence Prediction (NSP)
2021-05-25 14:56:47 UTC
https://youtu.be/1gN1snKBLP0
1gN1snKBLP0
UCv83tO5cePwHMt1952IVVHw
1gN1snKBLP0-t256.0
So this here is our CLS token. Okay and when I say this is our CLS token I mean more that this is not our CLS token.
256
285.04
Training BERT #3 - Next Sentence Prediction (NSP)
2021-05-25 14:56:47 UTC
https://youtu.be/1gN1snKBLP0
1gN1snKBLP0
UCv83tO5cePwHMt1952IVVHw
1gN1snKBLP0-t265.68
The CLS token is down here so we input the CLS token and this output is the subsequent output after being processed by 12 or so encoders within BERT itself.
265.68
299.76
Training BERT #3 - Next Sentence Prediction (NSP)
2021-05-25 14:56:47 UTC
https://youtu.be/1gN1snKBLP0
1gN1snKBLP0
UCv83tO5cePwHMt1952IVVHw
1gN1snKBLP0-t285.04
So this is the output representation of that CLS token. Now the activations from that get fed into our feed forward neural network.
285.04
310
Training BERT #3 - Next Sentence Prediction (NSP)
2021-05-25 14:56:47 UTC
https://youtu.be/1gN1snKBLP0
1gN1snKBLP0
UCv83tO5cePwHMt1952IVVHw
1gN1snKBLP0-t299.76000000000005
And the dimensionality that we have here is 768 for that single token. This is in the
299.76
321.36
Training BERT #3 - Next Sentence Prediction (NSP)
2021-05-25 14:56:47 UTC
https://youtu.be/1gN1snKBLP0
1gN1snKBLP0
UCv83tO5cePwHMt1952IVVHw
1gN1snKBLP0-t310.0
BERT base model by the way. And that gets translated into our dimensionality here which is just the two outputs.
310
332.24
Training BERT #3 - Next Sentence Prediction (NSP)
2021-05-25 14:56:47 UTC
https://youtu.be/1gN1snKBLP0
1gN1snKBLP0
UCv83tO5cePwHMt1952IVVHw
1gN1snKBLP0-t321.36
So that's essentially how NSP works. Once we have our two outputs here we just take the arg max of both of those.
321.36
343.6
Training BERT #3 - Next Sentence Prediction (NSP)
2021-05-25 14:56:47 UTC
https://youtu.be/1gN1snKBLP0
1gN1snKBLP0
UCv83tO5cePwHMt1952IVVHw
1gN1snKBLP0-t332.24
So we take both over here and we just take an arg max function of that and that will output us either 0 or 1.
332.24
353.6
Training BERT #3 - Next Sentence Prediction (NSP)
2021-05-25 14:56:47 UTC
https://youtu.be/1gN1snKBLP0
1gN1snKBLP0
UCv83tO5cePwHMt1952IVVHw
1gN1snKBLP0-t343.6
Where 0 is the is next class and 1 is the not next class.
343.6
368
Training BERT #3 - Next Sentence Prediction (NSP)
2021-05-25 14:56:47 UTC
https://youtu.be/1gN1snKBLP0
1gN1snKBLP0
UCv83tO5cePwHMt1952IVVHw
1gN1snKBLP0-t353.6
And that's how NSP works. So let's dive into the code and see how all this works in Python.
353.6
376
Training BERT #3 - Next Sentence Prediction (NSP)
2021-05-25 14:56:47 UTC
https://youtu.be/1gN1snKBLP0
1gN1snKBLP0
UCv83tO5cePwHMt1952IVVHw
1gN1snKBLP0-t368.0
Okay so we're going to be using HuggingFace's transformers and PyTorch. So we'll import both of those.
368
394
Training BERT #3 - Next Sentence Prediction (NSP)
2021-05-25 14:56:47 UTC
https://youtu.be/1gN1snKBLP0
1gN1snKBLP0
UCv83tO5cePwHMt1952IVVHw
1gN1snKBLP0-t376.0
And from transformers we just need the BERT tokenizer class and the BERT for next sentence prediction class.
376
402
Training BERT #3 - Next Sentence Prediction (NSP)
2021-05-25 14:56:47 UTC
https://youtu.be/1gN1snKBLP0
1gN1snKBLP0
UCv83tO5cePwHMt1952IVVHw
1gN1snKBLP0-t394.0
And BERT for next sentence prediction.
394
408.8