Hi and welcome back to this, because so we are finally ready to do the last step of this application,
which is, of course, to evaluate how our model performs.
So we will just see how it works first on our test sets and then we will try to play it by using some
custom sentences and to see how it reacts to it.
So, of course, all you have to do is really standard.
You have to call results equals to see and then that evaluates and you give it the test data sets and
finally you can just print the results.
So that will give you the accuracy and the loss on test data.
I actually want Renetta right now because it takes some time and unfortunately, I don't have like for
the training phase, the results that still are appearing in my notebook.
But the result I got was eighty four point six percent accuracy on the test sets.
So let's write it just so that we.
No.
On tests.
Sex equals eighty four point six, so that's what it gets on the test set, if we remember well on the
here on the training set we got.
Eighty eight point five, so there's a very big difference, actually, so let's go it to 88.
Point so back on train set equals eighty eight point five, so there is Ghaffur importance overfitting
in this process, but that's still a good result, eighty four point six with this model, because with
my previous model that didn't use the birds took Annisa, we achieved only something like 80 percent
accuracy on the testing sets.
And what we did during the data processing is that instead of using this burst organizer, I used the
whole organizer.
So that's also a tool that is available with Denslow and we created organizer on the go with the data
that we have with the corpus that we have.
So, of course, that's less efficient because first we have less data to do.
It's also it's way harder for us to get the optimal hyper barometer's than for wood piece, which is
the tokenized that we use that really involves a lot of time and computation and energy to that.
And finally, it's of course, less powerful because it's really biased, in my opinion, because the
tokenized I used before for this model, for example, which is data from Twitter in order to build
Annisa.
And that's really a very specific data set because people don't write on Twitter like they would write
on other media.
Or this is not maybe the kind of language that we would find in most of the books on Wikipedia, which
were the corpuses used for birds.
So that's kind of a specific Annisa.
And actually everything we learned in data science is biased according to the data we use.
And so that's why Burstow Conesa and we'll see later that model are really powerful because the corpus
that we use is really huge.
So each time we use those tools, we are sure to have more generality and more flexibility.
So that was it for the evaluates methods.
And now we can start to play a bit with it by ourselves, by creating a function that will take a sentence
as inputs and will give us the answer of our deep conviction on your network.
So we will say that gets prediction, will get a sentence as input and will first create the kinds of
course, so encodes sentence and applied to sentence.
Then we have to create the inputs.
So in order to do that, all we have to do is to simulate the batch because a model intensive flow always
works with batches.
So we have to send a batch even if the batch has only one elements so that we do with expense DMS,
that just means that we add a dimension to Takins and this dimension is the first one.
So we add NMT dimension that simulates the batch.
Finally, we can call output so output will be equal to D.C. and then apply to inputs, of course,
without training.
So that's not capital T without training because we don't want to apply the dropouts.
And now that have the outputs, let's say that sentiment is equal to math, that flow of outputs multiplied
by two.
The reason we do that is that for our test right here, we have two classes and we decided to go with
one output, one number as outputs with a sigmoid.
So that's a number between zero and one.
And it wants to know whether this the output is a zero or the one.
So I just decided to multiply the output by two.
So we get something between zero and two.
And this number, if it's between zero and one, that means that the class will be zero.
And if it's between one and two, that means that the class is one.
So that's why I multiply it by two and apply the flow.
But actually you could just round the number that will do pretty much the same.
And now that we have our sentiments, all we have to do is if sentiment's equals zero, we will print
something like outputs of that model and we print out the actual number that the model gave us.
And after that, that's the backslash and we will print the projected sentiment's.
And in this case, this will be negative.
Of course.
That sets that format and this is output that we want to print.
Now, let's do the same thing for positive sentiments this time, if it's equal to one, let's just
use it for the sake of it.
And this is correct.
And all we have to do here is to say that it's positive.
Perfect.
Let's run this.
And now we can do some tests with our personal sentences.
So let's try get a prediction with a sentence like let's try.
I'd rather not do that again.
So how does he think about this one?
That seems to have sense.
So it's a negative sentence, of course.
What about this movie was pretty interesting.
What do we get positive, really positive effects that seems to work perfectly fine.
You can now have fun with it, trying with your sentences and to see what are the flaws maybe of this
model, because it will certainly get some sentences wrong.
So you can try to play with irony or things like that and to see where it will perform was.
So that was it for this first application.
So of course, we did not implement a lot of birds in this one.
But the idea is just to show you how you can little by little add tools that come with birds to improve
the model.
And all we did in this application will be used in the next one where we will really use the bird,
lay the birds model as an amazing layer.
So everything here was not made just to introduce a token Aissa.
We would use exactly the same thing and we will improve this model with the embedding layer using bird
for real.
So this will make our next application really quicker.
We will be able to really focus on birds.
So that's getting more and more exciting popularity for this next application and using.