All right, everyone.
So the next topic, which we are going to learn in this video, the vocabulary now matching.
So there are mainly two ways in a spacy you can do the matching like a rule-based matching and a phrase
with matching.
So we won't know right now into a rule-based matching or a face based mating in a python code.
Instead of that, I will show you about one demo.
So let me go to that Nemo.
And the creator of this spacy day who created this demo of Rule-based Metcher Explorer.
Now here, the writing biting cold.
That won't be a very big deal.
So the important thing is that how you define about some kinds of pattern, the pattern you define in
case of regular expression.
So this is like a little advance pattern.
You can define with respect to different vocabularies of this natural language processing.
So the important task is that how good you are at a defining pattern while you are searching for something.
So this is the rule based matching pattern demo they created and will how little practice it?
How you can define those pattern and often the pattern guard defining the match found close or not.
That is the job of this spacy labeling.
Now, if you want to go much more detail into this documentation of rule-based matching and a face based
matching, you can refer to this spacy documentation that is a kukan measure that is nothing but a rule
based measure.
And there is a phrase mismatch.
Quite right.
So by default, they have given some tests.
So out of this text, we are going to search for something.
And our default model will be a small size of a core English.
Martin, let me select this so token.
Now, already there are a number of patterns they have already defined.
So as of now, it just doesn't make any sense for us.
So let me just remove this token.
So let me be Lamarr will be match and.
Horse.
That means it's a part of speech, tagging will be known.
And even let me remove this.
Now you can see our pattern of variable is empty.
So let's add our very first token.
Let's say out of this particular full tax or I would say document, I want to search for something.
So all those rule, you can define it as an accident.
So something like you want to search for something in a lower piece.
So all those rules will be applied on every single token.
So first, this will be passed to this model and this model will create those token.
And based on all those tacked on, we will define that, will search for those kind of back on inside
all those tokens.
So let's define our first.
Pattern.
So let's say there are a number of rules you can define here.
Let's say we want to search for something is legit or not.
In this particular stock and I'm just making selected.
And you will be able to see one pattern and define in a dictionary for me like that.
It will be like he's underscored digit will become true and fighters that have faced attacks.
You'll be able to see.
That is no match found.
But suppose in between somewhere, I would just skip, let's say two, three, four and five fist attacks
will be able to see it has able to find out.
Two, three and a four.
That means that is BGT.
So if anyone a phone's digital in a token, it will give us.
Suppose along with it.
Two, three, four.
Suppose I just make WUIS.
So it will be a one gonna to do.
It will be a different token.
Let's see how it goes.
So you can see it is considered as a single token.
And that's like this.
He's dead bodies in this digital phase.
And it is unable to find out any match.
All right.
So that is one thing.
Let's see something as.
Let's say entity type.
So let's say entity type organization.
So is there any entity, diabetes organization in this particular tax?
So most probably one one.
So let's just keep let's say, the company Google name.
Let me keep it here.
Even a specialist, I am not sure.
Species of organization or not.
And let referenced attacks.
And you'll be able to see Google got found, Google match found, that means Red River, that entity
type his organization in any of the tokens.
That will be a match phone.
But SBC has.
It's a high voltage.
Wrong.
So let me refresh this.
No, no species, not a organization in that database might be.
All right.
So that is like a very simple single attribute we have, right?
But suppose.
Along with the hurricane, let's just go somewhere else, let's say lemme so lemme Morozova.
So there is a B..
So any token who's Lamma was and will be a B, it will find out.
Spillages refreshing.
And you can see he's lamb of LBB, high lamb of LBB, so Vedova and me, Lhamo, so will we be.
So it has found a match.
He's hot.
And a meat.
All right, so let's try something else.
Let's see.
We will keep Leiker a stop.
So is there any stoppers are not.
Let me refresh you.
And you'll be able to see all those stopwork.
It is able to fine.
Now let's hear something else.
So let's say lower and we want to search for something in the lower, let's say small wooden.
So small.
And then you'll be able to see lower will become small.
Let's add one more token.
It will be a lower and.
Let's say we are searching for one.
So the Lord wasn't of any.
Will be find out.
Let's refresh it and you will be able to see small wooden.
Find out.
Now, suppose, along with the small wooden.
Somewhere.
I'll just make it.
Capitals on capitals, capitals, small.
Whoo!
And let's see.
And let's see whether it is able to find out or not.
All right.
So you can see small more then also got final.
Now let's have one more thing I want to tag along with a small wooden in between, that has to be some
magic bullet.
So we have to keep it some digital here.
So let me remove it.
Let's add.
Hoopes.
So Lowitt, let's say.
Small and.
Let's add one more token, let's say the Jeep Hayes digit.
Let's add one more Pokemon like Lowitt and it will be wooden.
All right.
And let's Surfest attacks.
All right.
So you can see now it isn't it has not found those match like a small wooden, but it is searching for
small then.
Is there any d.g?
And then there is a wooden token.
All right.
So you can do all those kind of mysterious stuff with this viler finding the patterns.
And you can see this way, you can define those patterns.
Now, how to do it in our patent code?
We will see in the next video.