So in this lecture, you're going to be assigned another exercise, which involves returning to CNN's
you've just seen that we can use Arnolds for many, too many tasks.
We already know that origins are pretty well suited for NLP and dealing with sequences, but we've also
seen that CNN's can be used for text as well.
So here's a question to consider.
Can we also use science to do many too many tasks, such as parts of speech tagging or recognizing named
entities?
The short answer is yes, but your exercise will be to demonstrate that this is true by building such
as CNN.
Now you might think that this will be pretty easy, as you've seen, our CNN and Arnon for classifying
text are nearly identical.
We simply switch the Conven D for analysis to.
However, this is, in fact, quite a challenging exercise.
I won't give away all the details, since that would make the exercise too easy.
The goal is for you to encounter and recognize problems on your own and when you do figure out a way
to solve them.
But here are a few hints.
Firstly, we know that the size of the data as it goes through the layers of a CNN can change.
But we don't want this since in our case, the output must have the same length as the input.
So consider what the CNN architecture has to be, such that the sequence length does not change as it
goes through the network.
Secondly, we know that we need to have some way of ignoring the padded tokens.
Otherwise these will be included in the loss, which is not correct and will lead to suboptimal performance.
We saw that setting an argument in the embedding layer called mask zero seemed to work.
The other option was to create a custom loss.
You'll need to figure out which of these options works for the convolution case.
As a small hint, this might be more difficult than you assume.
Understanding how things work will be important, and using arguments just because I showed them to
you previously is not necessarily a good idea.
In fact, we already learned how this can lead to misleading results in the previous example.
Remember that just because your notebook doesn't throw any errors does not imply it's correct.
As you saw, you can get 99 percent accuracy even when it's not correct.
So you should devise methods to check whether or not your results truly reflect your model's performance.
So there are some final questions you want to consider once you get this working.
Firstly, how does the CNN perform relative to the Arnette?
Is it better or worse in terms of the various metrics we care about?
Secondly, you should compare the training and inference times of both the CNN and Arnett.
Consider if you had to do this task for a Real Worlds project, which model you would choose.
Given the above two results.