Hi and welcome back to this bird course.
So we are here for our third and last application using, but this time we will use but as it was intended
to be.
So we will find two units for actually a whole new task.
So we want stick with this Twitter sentimental analysis forever.
So let's change the task and do something other than classification.
We will actually try to have a good call with the squad, which is one of the standard benchmark for
NLB.
And the squad is about question answering system.
So the idea of this is that we will have a paragraph that contains information about a given topic and
then we get answers about this topic.
And the idea is that we want our eye to find where the answer to this question is inside the paragraph,
inside the given text.
So if we have a look at the website for this, it's quite so.
Stanfords question answering datasets.
We see that there are two versions of it.
There is the one point one and the two points.
We will, for the sake of simplicity, use this one.
Actually, the idea about the second squad is that sometimes the answer is not in the original text.
So that's one of the answers that I should give.
If the I think that the answer is not in the text, it should set.
And but he will stick to the more simple version where we know that the answer is in the text, so we
have to give it.
So let's have a look, for instance, at what it looks like.
By picking a deaf, a deficit, whatever, something about Martin, you do, so you see that we have
a few lines of text that contains information about this person and we have here a list of questions
about it and the corresponding answer.
That is the substring of our original texts.
So this is what it looks like and this is what Will will be working with.
Unfortunately, it seems that the training sets for this quite one point one is not available anymore
on the website.
So you should go to the very beginning of the course and go to the curriculum parts where I provide
a link to download the tests, the training and deficits for squad one or one.
And once you do, that will do the same thing as for the previous application.
So the idea is that you need to drag and drop it into your personal Google Drive folder.
So here you see that in my data squad for the I have a lot of things you'll see later is because we
will have to do some data processing to store the answers or this kind of stuff.
But the things that you have to have in your folder are Dev one point, one Jizan and train via one
point one Jizan.
And the other thing that we will have to do is to add these vocab dot files.
So that's actually the least of the vocabulary from our tokenized from best organizer extracted for
you.
So once again, you will be able to get it from the curriculum file at the beginning.
So just download those three files right here, put them into a folder of your personal Google Drive.
And right after that, I think we are ready to start working on our A.I. But just before doing that.
Of course, I will quickly explain what we will be doing because this is not a classification tax.
So as we said before, we have two different types of inputs with bots.
So we have the first one, which is just one vector, which is supposed to represent the whole sentence.
And this is mostly used for classification task.
And the second one is a list of vectors, each vector being a representation of the words in its contexts.
And this is actually the one we will use for this problem, because, of course, this is not a classification
task.
And what we want to do is in our first sentence, because the first sentence here represents the text
and the second sentence will represent the question.
So in the first instance, we want to find the beginning of the answer and the end of the answer.
So that shows how we want to work at the 21CN level, at a word level and not add a sentence level.
So that's the first thing that is important.
The output of words that we will use is the second one.
So we will get a list of actors.
Second thing is how to use them.
Actually, most of the time with.
But all you have to do is to add one then layer before fine tuning it and the dense layer that we will
use and that we will apply to each element.
Each vector is a dense layer with two output units and the first output unit will represent the score
for being the starting position of the answer, and the second unit will represent the score for being
the ending position of the answer.
So by just applying a dense layer with two outputs, you need to each vector each word.
Representation we get for each word is called for being the beginning of the answer and the end of the
answer.
And so basically, if we just switch the way we see it, we get a list of all the scores for being the
beginning of the answer for each word.
And a second list is score for each word of the paragraph for being the end of the answer.
So that's actually pretty simple.
We just use the second outputs of birds so that we have a vector for each word of our paragraph.
Then we apply it to output units dentally to each of those vector so that we know if they are likely
to be the start or the end of our answer.
And basically, we take us into the substring of the text that starts with the talking with the highest
number from the first outputs of our Denselow.
And this substring must end at the position where we have the highest number, the highest score for
the second outputs of our Denselow, which represented the score for being the end of the answer.
Of course, we need to add the condition.
That's the starting position is before the ending position, but that's a detail.
So that shows how the task that can seem quite complicated.
Actually, we want to find where the answer to a question is in a text can be tackled quite easily with.
But we just need to pick the right output of birds for that.
We want to use and to use a dense layer in a clever way.
And that's it.
So now that we know what we are going into, let's start the coding phase and to use an.