All right, everyone.
So the next topic, which we are going to learn is named entity recognition.
So for illustration purposes, I kept you three sentence.
Let's say Apple is looking at my UK startup up for one billion dollars.
So name recognition is something like whenever you encounter, let's say, some organization, some
in some places, if you can go to the species documentation inside that there is a linguistic feature
so named entity recognition.
So this spacy named entity recognition can recognize, like a company location, organization products
very much easily.
And out of all those tax, if you have already an idea that if you are looking for Apple as an organization,
you can even take Veigar, this is a for further analysis of your tax.
So name entity recognition is one of the very crucial and an important step for understanding of your
tax.
So I woke up here three documents or I would say three sentence saying we are going to find what are
the name entities that are associated with them.
So let me execute Lisburn.
And I'm going to Laura, a small size model in English language, and let's apply this sentence one
by one and create a knock object out of.
Brian LPT.
Let's say Esslin and I'm going to assign you to, let's say, park one.
And just like earlier, we help grab this.
What I would say limited edition and tokenization saved me.
This penalty is not just to go squill for getting some particular text analytics process.
Instead of that, it's a very generic function which will pass through your text or any kind of full
document which will return us a very high level document object.
Like a lot of things, tagging, passing, cost, tagging, naming BD recognize just tokenization.
Lemrick, I design everything it will take to extract it.
So this is like an a very common Tarpeena especially.
All right, now, to get the entities we can just simply use, like a E.A., yes.
And let me run it.
Let's see what it was written.
So you can see it has identified that there are three entities are available in this particular statement.
Now, that is Apple and we have a UK and one billion dollar.
Now, other all like an envelope or a known.
So what we can do if we want to get detailed explanation about this entities, we can decide later what
part.
Let's E.A. in, let me bring this E.A. tech sector.
Let's say I want to grab ENFP thought, the label name, that Apple is like an organization or it will
be kind of poison.
So what is the entity?
It belongs to so label undisclosed.
And if I just run, it will get a little bit more detailed explanation.
So Apple is or do your arguments.
It's an organization.
UK Teckman say it's a geographic location.
Cheapy and one billion dollar.
That means it's a kind of money.
If you want to get a little more detailed explanation about this entity type.
We can just simply use SDR.
So just wrapping around that string function as their function and we can use like us Plessey.
Explain.
And here I can pass E.A. not label it so little bit more descriptive stuff.
Hurricane.
Now you can see Happel is organization and its legal description will be something like it's a company
as INSEE institution.
This is G.P payments.
It's like a country's cities, states.
And one billion dollars is associated with money, monetary values, including even you need also.
All right.
So that is about the Hasman.
Now, it has not left any particular over, which is not at all.
I mean, with this entity and it has not recognized in FUSCUS, let's try to apply same thing for S2
and let's see how it goes.
So let's say high school and all this Mikie document to
now has to is like San Francisco considers banning sidewalk delivery robots.
So from this particular document or a sentence, it has just identified San Francisco as a country apart
from all other.
They are not considering as an entity like.
OK, let's call it the third one.
So let me paint when that three first and let me make it documentary.
And let's run it.
All right.
So you can see it as they're displayed DST, that it's a Facebook is hiring a new vice president in
US.
But from this sentence, it has just identified us, has a name entity, and that is nothing better
countries.
And that's perfectly fine, but has a leader.
It has identified Apple as an organization.
But here in this case, it has not identified.
Facebook has an organization or any kind of neat even it has not identified as a name entity.
So that is a provision in a spacy to add some extra tokens as and name entity also.
And we can even assign those things as a specific entity.
So how we can do it?
So what we can do, we how to create a new objects, let's say.
Not the not entity.
If he were displayed here, there will be only one entity that is the US.
So here we need to add one more thing so we can just simply use it like this and let's create some new
entity.
Let me assign it like a list.
So we are ready.
One more angry and this entity we are going to define like Facebook is like an Apple.
So that will be an organization.
Companies, agency or institution kind of naming.
And this thing, I'm just going to assign it to Doctrine ENP.
All right.
So now our objective is to define this new entity.
So let me create a few more subtle.
And to define this new underscore entity, we are going to use the span so span.
And this particular span requires.
Offshore arguing.
So first, the argument is from which document you are looking for some entity.
So that will be a No.
Three, and that will be a very first token only or from which token to which token you are looking
for.
So only for token.
So zero to one.
And what other types of this new entity you are referring to?
So that will be a legacy label and it will be equal.
He cites an organization.
Now this audio is so you need to define it.
So.
How will define it?
So we are going to use these Lochley, not Rocket Springs.
And let me add here, or, you know, this particular span, we have to import it.
So before this new entity, I'm just going to import.
From spacy dark dawkins'.
Import.
Span.
OK, so we have defined a new or R d organization kind of object.
If you just execute it for you will be defined.
Now from this basically tokens, that is a span function is there.
So this band function will create a new entity for us.
From this documentary object, and now we are going to head this new entity to our existing and to do
list in this documentary, Rocky.
So inside this documentary, very well, wherever this Facebook will appear, it will be identified
as a name entity.
All right, so now let us please play Lockheed or even Pierce.
All right, so now you can see Facebook karma, you dartez that means to name and delete has recognized
if you can.
Let's say around this one again.
All right.
You can see.
Hopes.
I hope.
I mean, executed this part again.
That's why it is just that.
So what we can do.
We can just execute this one again.
All of them.
So it will add one more entity, like a Facebook and let me remove this one and let dissipate over everything
that entities in this Dockley.
And you'll be able to see there are two entities it has recognized.
Facebook and the US, Facebook, his organization.
US is like in a country's geographic location.
Now, let's say same thing, if you want to do some kind of Zuli, you want to display.
And for that, we can use from a sea import display.
Actually, it's a display.
See?
All right.
So we can use like in this place, we know, let's say, a vendor.
Now, here we can pass multiple arguments.
Well, it will be against the first argument will be dock's.
So what dogs we are referring to, let's say we want to display Forder knock one.
We our learoyd.
So define this document that is corresponding to this Apple string Apple is looking for and style.
So.
Let's just make it.
What other possible styles.
And you can see there is the one BP heading there to go to their documentation.
But I only know that it's in a.
ENFP.
And let's make it Jupiter easy, equal to prove otherwise, it one this.
Yes.
All right.
So you can see in a very beautiful, nice manner.
It has a scientist.
Apple has organization, UK is a GP and one billion dollar that is like money.
Now, suppose out of this entity, you will just want to find some specific entity only.
So the same function, you can use it.
But one more extra argument you can add.
Let's say option an option.
You can it like on a dictionary.
Let's say d.a.'s.
And let's see, I just want to display organization finally and let me put it a comma like this display.
All right.
So you can see only organization, it has displayed Bud Light.
So that is the whole story about the name and recognition and how to do very easily distinguish functions
are really well inside the space.
All right.
See you in the next video.