Hello guys.
So in this video we are going to discuss about Knowledge Graph.
Now what exactly is a knowledge graph okay you can consider Knowledge Graph as a semantic network.
Please focus on this keywords which I am actually specifying.
It is also known as semantic networks.
And this network represents a network of real world entities.
So let me just go ahead and write this.
This is nothing, but it is a network of real world entities.
Very important thing.
Okay.
Now in this real world, uh, entities, you know, uh, if I just consider some example of the real
world entities, I may probably say, hey, um, there may be some kind of events, right?
There may be some kind of situations.
There may be some kind of concepts.
Right.
And this concepts or this situation may illustrate may illustrate the relationship between them, The
relationship between them.
Okay.
See, whenever we talk with respect to NLP, use cases.
Right.
Let's say I have a sentence.
I have sentence like this.
Okay.
Let's say Rohit Sharma is the captain of Indian cricket team.
Okay.
Now here you can see when we consider this entire sentence.
Okay.
Here you will be able to see there are some important entities also.
Right?
I can probably say, hey here we are talking about Rohit Sharma who is a person.
This is another one important keyword which is called as captain.
And this is their Indian cricket team right.
So we are here, we are able to specify from this particular sentence.
And as a human being, I will definitely be or you will be definitely able to understand if you have
the knowledge of cricket right here we say that, hey, Rohit Sharma is the captain of Indian cricket
team.
So Indian cricket team I can consider as a separate entity.
Rohit Sharma is a separate entity and there is kind of situation.
There is a kind of relationship between Rohit Sharma and Indian cricket team.
That is nothing.
But it is with respect to the captain, right?
So obviously when we take this entire sentence for us human beings, we can definitely understand what
exactly the sentence is.
But to make a machine learn much more efficiently, right?
It is a better way that we can actually represent this data in some different way.
Right?
And that specific way is what we are going to talk about.
That is nothing but knowledge graph.
Now let's talk more about this and you will definitely get a really good idea about this.
Okay.
So here you'll be able to see a knowledge graph.
if I just consider about our knowledge graph.
Okay.
It is made up of three main components.
Let's talk about this particular components.
One is something called as nodes okay.
Second is something called as edges.
And third is something called as labels.
Okay.
Now let's see what this exactly nodes specify I can say hey any object.
Or any place or a person.
Okay.
I'm just giving some example.
Can be a node.
Right.
So here what we are specifying a node.
What exactly is a node.
Node basically means it can be in any object, any person, any place or any noun.
You can also consider it as a noun, right?
Can be a node.
Okay, if I talk about edges, right?
An edge
defines the relationship between the nodes.
Okay.
So edge is what it defines the relationship between the nodes.
Right.
So here if I just consider right some examples.
Okay.
And uh my example is something like Rohit Sharma is the captain of Indian cricket team.
Okay.
So let's talk about this okay.
So here I will.
You know that an object, place or person can be a node okay.
And here you'll be able to see that I will go ahead and create this node.
This is my first node here I'm just going to write Rohit Sharma okay.
So let me write it in another color.
So let's say here I'm going to basically write Rohit Sharma Okay.
My second node.
If I draw it over here is nothing but Indian cricket team.
Indian.
Cricket team.
Okay.
Now we know that according to the sentence, we are saying.
Hey, Rohit Sharma is the captain of Indian cricket team.
So when we say, hey, he's the captain of Indian cricket team, that basically means we are trying
to show some relationship over here.
So Rohit Sharma is somewhere related to this Indian cricket team.
And that is where your third component comes into label right.
In order to specify what kind of relationship is there with respect to this particular node, that is
where we are going to use this label.
And here the label will be nothing, but it will be something called as captain.
Right.
So this is how in a knowledge graph this entire sentence is basically represented.
Okay.
Rohit Sharma is the captain of Indian cricket team right now.
Why do you want to represent.
Just think over this okay?
Why do you specifically want to represent right the data specifically in this kind of nodes and edges
and labels.
This is really much important to understand.
Understand this is just one of the text.
I may have another text over here okay I may have some text like this.
Virat Kohli I hope everybody knows about this.
Two famous people, right?
Is the player of Indian cricket team now I have used my second sentence.
Okay, I have used a second sentence.
Virat Kohli is the player of Indian cricket team.
So in this scenario, what I will do, I will just go ahead and create my another node.
And in this node we will go ahead and write Virat Kohli.
Write Virat Kohli.
Now when we write Virat Kohli over here, right, you'll be able to see that Virat Kohli is a player,
right?
So this is Virat Kohli is basically related to the Indian cricket team with the label that is nothing
but player, right?
So this becomes another relationship, right?
Now finally, you can see that if Rohit Sharma is the captain of Indian cricket team and Virat Kohli
is a player of Indian cricket team, let's say that if we go ahead and ask our or along with this,
if we just go ahead and create a Genie application along with my login and some LLM modules, don't
you think that with respect to this specific relationship, you know there can be some relationship
between Rohit Sharma and Virat Kohli?
We can derive that right?
And that is what this entire knowledge graph does.
Not only this, there may be more nodes, more nodes which may be related over here.
This will be related to.
Let me just go ahead and write this.
This may be related to here.
There may be again another relationship which you can specifically derive.
This will be another relationship which can be connected to this.
Right.
So so many different different connection.
And just imagine when you have this huge amount of data, when this kind of graph is basically created
and this is nothing, but this is my knowledge graph.
And based on this knowledge graph we can derive many, many things.
Even our recent like in Google, the search engine.
Google search engine, right?
Let's say if I am searching for Virat Kohli or Virat Kohli, then after getting the result of Virat
Kohli, I may get some suggestion with respect to other players.
Let's say like Rohit Sharma.
How this is possible because Virat Kohli, you know that it is playing under Indian cricket team.
We get to know more about Indian cricket team along with Virat Kohli.
All the information that you will be seeing and more suggestions will be able to get about Rohit Sharma.
And that is how this entire Google search engine will be able to derive information that are related
to Virat Kohli.
Because this entire graph, this entire knowledge of graph is connected to each other right between
nodes with respect to relationships.
And that is how each and every suggestions that you will be able to see.
And this gives you a clear idea about knowledge graph.
Now let me do one thing.
Let me just go ahead and show you some of the amazing examples directly in Google Chrome, because Google
search engine is the best example of specifically using this kind of knowledge graph.
Okay.
So let's go ahead and see that.
So guys now let's go ahead and see some examples from the Google search engine.
Because I feel that Google search engine is one of the best example to probably showcase the working
of the Knowledge graph.
So here right now, uh, I have not even signed in in my Google account.
The reason is very simple because I do not want my search history to impact the kind of queries that
I'm actually searching.
Okay, so here, uh, if I just go ahead and click it, these are all the trending stories, uh, trending
searches that are probably showing up over here.
So let me do one thing to start with.
I'm just going to take a basic example.
Okay.
So I'll go and search for my name Krishna.
So let me just go ahead and search okay.
So here you'll be able to see that I'm able to find out some of the information.
It says, hey, I'm a YouTuber.
Along with that, I also upload videos on Udemy, as you all know.
Um, along with that here, you'll be able to see that I have my profiles LinkedIn, Instagram, YouTube.
Right?
And here it is also specifying what all books you have actually written about me.
This entire Google is providing it, right?
So once I search for Kreshnik, you can see that since I, I have been using Google products for a long
period of time, like I've been using Gmail, I've been using Google.
I have my own Google account, right?
You'll be able to see that it actually has taken my entire data, and it has created that kind of knowledge
graph, because when I search for my name, it is showing my YouTube channel.
If I go ahead and see in the videos, so many different, different videos are there with respect to
my YouTube channel.
Not only that, people also search for what kind of important suggestions are there that also you are
able to see, right how this is entirely possible.
It is very simple that it is uh, it is possible because that entire knowledge graph is actually present
with Google, and based on that knowledge graph, it is being able to retrieve lot of information.
Now, when I'm searching the specific information, let's take a different example.
I will go ahead and write Einstein.
Okay.
So let me just go and search for Albert Einstein.
Now in the case of Albert Einstein here you can see theoretical physicist is basically their overview
education.
And now this person like Einstein was born on 14th March 1879.
And he died and he died on 18th April 1955.
Right.
So here you'll be able to see about Einstein.
We are able to see all the information and whatever research he has specifically done.
All those research will also be visible as we go ahead over here right now.
This is what is there in the in the in the knowledge graph.
Right.
How Albert Einstein is basically connected.
Now this is really important.
So this is all information will be able to see about Einstein.
Right.
All the information influence spouse grandchildren children.
All this information is there okay.
Perfect.
Now if you go ahead and see here, you can see people also search for these all famous people.
Now here you have Edward Einstein, you have Isaac Newton, you have Stephen Hawking.
Wright Hawking.
Why all these researchers are like given as a suggestion for you.
The idea is very simple because Albert Einstein was a researcher, right?
And theoretical physicist.
He was theoretical physicist who created this amazing research.
He did amazing research on different, different concepts, different different things, and that all
are available in the internet, right?
And based on that, you're able to see that they are also trying to find out the link with respect to
other researchers like Isaac Newton.
Right.
Because Isaac Newton were also there at this particular time frame when gravity was probably, uh,
you know, that Apple fell on his head and he was able to completely invent gravity completely through
his research.
Right.
So here you could see that.
Then you have Stephen Hawking's, you know, so all this information, how they are actually related
to Einstein, that is basically shown over here.
And that is all possible because of this knowledge graph.
Right?
Obviously when I'm searching for Albert Einstein, Albert Einstein, uh, when I search for Albert Einstein,
uh, they're not going to give the suggestion of my name over there.
The idea is very simple over there, because I am nowhere related right, to Albert Einstein in terms
of research or anything else.
So it is completely different, right?
So that is how in this world, since there are huge amount of data that is available in Google, right?
And there you'll be able to see that this kind of knowledge graph is created with respect to nodes,
edges and labels.
Right?
And that is how this entire Google search engine is working behind that, right?
Even YouTube search, completely YouTube search, the kinds of ad that is visible on you are like what
kind of ads you will be have.
You'll be able to see it.
That entire thing is controlled by this graph knowledge knowledge graph itself.
Right?
So I hope you are able to get an idea about knowledge Graph.
And I hope I was able to explain you this in a pretty easy way.
Okay, so in the upcoming videos we are going to discuss about Neo4j's graph database.
Uh, and yeah, I just want to show you one more example over here.
Uh, let me hide this.
So this is what a neo4j's database looks like okay.
And I have inserted huge amount of data over here just to try out multiple things.
Okay.
So let's say there is a relationship over here.
I'll just, uh, and one of the relationship is something like chief Executive Officer.
So once I click this here, you'll be able to see this is the this is the query that you are able to
see over here.
And this query is basically called as a Cypher query okay.
So usually whenever you work with the graph database, uh in the graph database you specifically get
this kind of Cypher query.
Okay.
Uh, so this based on this Cypher query, you can see that as soon as I selected a relationship, like
chief executive officer, it shows.
Hey, Elon Musk is a chief executive officer of Tesla, right?
Not only that, uh, let's, uh, select some more thing, right?
Like trillion dollar, uh, trillion dollar company.
So here you can see Tesla is $1 trillion company.
Right.
And this is the query, uh, that is there.
I'll try to show you.
I'll give a tutorial with respect to the Cypher query as we go ahead in the series of video.
Okay then, uh, let's select some more.
Okay.
So here you can see there are nodes okay.
Nodes are over here there are relationship and there are property keys.
Property keys are nothing.
But it's just like a uh you can you can just see that, uh, relationship are nothing but this specific
relationship along with the label.
If I go ahead and click on property keys, let's select one of them.
Okay.
There you'll be able to see some values that are really related to this kind of searches that we specifically
do.
But anyhow I will try to show it to you.
Uh, some more examples if I try to go ahead and show you over here.
Okay, let's see some more things.
Right.
Let's say best selling is there.
Okay.
Now here you can see Tesla.
Uh, there is two best selling models that is model Y and model three.
Right.
And this is the query that you have with respect to that.
Right Then um, let's say I will go ahead and do select one more thing.
Inspiration okay.
So here you can see, uh, a piece of writing inspiration, all this information, how it is there a
piece of writing that expresses emotions or ideas in a rhythmic and imaginative way?
This is a poem, right?
I've taken a poem I've inserted into the entire graph database automatically from that particular graph
database, Since I've used this neo4j's along with lang chain, you'll be able to see that automatically.
This nodes are.
We are able to create it, and not only nodes, we are also able to create this kind of relationships
itself.
Right.
So all these things we will proceed and we'll see.
It'll be quite amazing and interesting when we will be starting this from this completely scratch and
will be understanding more about it.
So I hope you like this particular video.
Uh, this was it for my side.
I'll see you all in the next video.
Thank you.