DevReal: Loading the world's biggest knowledge graph into neo4j, Leann Chen
Recording: DevReal: Loading the world's biggest knowledge graph into neo4j, Leann Chen
hello everyone um I'm lean chin I hope I intentionally put my name all in capital letters hoping everyone could see it unfortunately for the people over there like you're too far away from from the setup here I apologize for um the setup of the location so yeah anyways I appreciate everyone coming um I guess let me guess a number probably 95% of you came here after work is that true yes yes yes okay so um actually like I've been thinking about like what uh what could be fun for tonight's meet up because like if it's just like you know presentation and you're already pretty exhausted from work and do we need more slides do we need more you know like bullet points so um uh so this is um actually my first slide and also my last slide and and uh people like if you already know NE because like uh Alexi just um did some poll and apparently some people already know about neop for so those who already know about neop for can you kind of like you know turn on the switch a little bit like pretend that you know nothing about NE for okay just for a second just for a second um what do you think this is like is this an AI generated image no then what could it be like it it looks kind of weird right like what does it look even it it looks something you would see in your physics textbook right something like that so is there I I just wonder if there's any like creative like imagin who looks like a flower it looks like a flower oh wow I that's A New Perspective how how come okay but yeah but it kind of looks like I I like that answer any other guesses I guess or broccoli oh it's a well well okay so right now we can kind start like remember like four dolls like um you know like you can recall back NE for uh thanks to the the colors they have here um it's a colorful broccoli that you're seeing here okay anyways uh I'll just jump to conclusion so um I'm I'm from thebot and uh we're basically uh we we created the N the the largest NRA and I'll explain that in a just a few second but I guess a lot of you already know knowledge GS or not like how many of you already new knowledge W okay so for the rest of you like when you're on Luma and you look at this events like just Alexi already mentioned there are eight others uh meetups happening at the same time and assume all those other meetups also have free pizzas too right then what are like like why do you sign up to this like is it like is it because like you want to know about knowledge gra or or Le forj or or you think you probably aw as J love will provide better pizzas I don't know any other guesses I answers yeah go ahead ah okay doing some extra exercise here hello folks here trying to give you some attention um anyone want to share like why are youly ask the question I see funnels and funnels oh that's a very marketing thing yeah it sort of looks like a fun like well right now look at it so I I have a dog and sometimes my my dog would you know trying trying to lick uh you know some something that she shouldn't lick and I would put on like a kind of like a in front of so so that she she doesn't do anything Stu anyways um so for for those like I mean people don't really share like what like why why they sign up I I would just assume for better pizzas but for those who don't really know about knowledge gra later tamas will give you a very detailed explanation of what M graph do um what I plan to do is I'm not going to tell like go like the the ly explanation of what Knowledge Graph do but later I want to play a game with you guys because that sounds more fun I guess and this game is called life demo why because sometimes you really need the god of you know the the uh god of the demo to be with you to have things successful but that's actually too predictable and too boring so what I'm going to do is um I'm going to show you a demo and it's you're you're later you will have a better kind of like uh understanding of okay what what does Knowledge Graph uh can do with or be helpful with llm based applications such as rack uh retrieval aganda generation and um like how does how does know like how can it be helpful and what are the roles between you know n longra and you for as a graph database and how they how they can work together so what I'm going to do here is um and I'm going to show this uh like a GitHub open source project this is you probably already uh like a lot of people already know toage or you actually came here because of him because he's such a superstar uh this is is one of the um the demos that uh the the prototypes that uh we pre previously built but he did 98% of the work so I'm hyping I'm hyping the mop and what I'm going to do is and so this is a mini graph rack project which means um uh like you have Rag and it's based on a graph and uh what what can it do and I I'll show in a minute so the back end of this graph rack is absolutely uh backed by M for J uh as you can see here uh wait a second let's still so right right now see the the database you see like a lot of nodes right and and the relationships and I'm going to clean this up because I'm going to show everything from scratch so let's uh first wait a second I'll clean everything and delete okay just to show that so so see deleted um 300 nodes and [Music] return okay okay so it's clean right now and okay so before okay so so before I I start this demo I I want to ask like do people nowadays still read news no right yes like like New York Times the type of thing new yorktimes with news with the News Real News Real News newspaper news the paper oh okay okay so uh it's a it's a shame to admit but I'm part of Jen j z so so how I absorb news is actually from Instagram Tik Tok Facebook those like very artificial you know like like the the Medias and okay well this another tent we're not talking about this but but let's say if like you're you're in business and you want to know like more seriously about like what's going on for example a a few days ago um the uh the the election you know there's a new president uh nothing about politics but you want to know about like how the stocks are going and I heard like Dodge coins are doing pretty well right anyways but so if like you're trying to do some like market analysis they say Okay I want to know about um like after this certain event and how these companies are doing or do if they H are having like a new model or something like that so for example like Nvidia I think people don't know about Nvidia um if I want to know what's going on with them and I'll and I I can like do real time um uh realtime articles crawling I'll just import 10 articles like this is 10 recent news about Nvidia okay so right and um urgently I have that my database is clean okay now we have something okay so as you can see here now we have 1 2 3 four 5 six seven eight nine 10 we have 10 articles here see so so these are the the articles that somehow um as suggested by the title or in the context is um uh U mentioning or related to Nvidia so let's see is there's a an article that we can pull up from so for example this one can is it big enough I guess so okay so uh like this is essentially like using the B API because we record the entire internet and we import it we can like like basically all articles or uh data on internet is being instructure like as you can see here and if when I click on the link it goes here and this is something that this is actually I guess eight hours ago this is a news literally from from today okay so what I'm going to do is right now you see there's just just a few notes there's like only um you know like small graphs and what the graphs are are doing is actually um like like the Articles and it's mentioning the the different organizations that been mentioned and what what are we gonna what what are we doing with this data so let's actually show this so basically we actually just create a a small like a graph rack type of thing if I want to say okay summarize uh What's this called okay summarize this article for for me and don't include chat history see the rag mode is Vector only okay so it's generating like re uh like real time summarization and this is essentially uh like the the data from it's it's pulling from NE forj the the data back end and how do I know like this summarization is pulling exactly the the right place so if I click on this this is the context data and you can see this entire articles is literally here to and here okay so this is a small um like a simple Vector based rack because and like uh while Neo forj even if it's a like a graph database it it can also store like unstructured text text Data too but like um what I want to like let's say Okay I I read this news and I actually come up with more questions such as okay like Nvidia I I learned this company but I I really want to know more holistically what this company is about right such as competitors right who are nvidia's competitors even though right now it's like pretty much no right because uh the stocks are like Sky rotting but let's say we want to have like a more holistic um information about Nvidia but right now our graph database like we don't we don't have that right like if you go this is see there there's nothing around here so what I can do is I can do oh okay so first I will do um and the natural language processing it's uh basically just to extract some of the entities or relationships from the AR articles we'll first do that let's give it a little bit of time gu it's working and uh yeah bar me this is an exciting part Wai so okay done process 10 articles and let's run it again okay so you right now have a more enriched uh enrich graph which like it includes all the relationships or or um entities and articles and now further explain what this will do so just beare me and okay video so so if I say no chat Asian I say tell me about Nvidia uh like industry competitors or suppliers if I do this it will tell me the context provided doesn't uh include specific information because we extract because our our data is just limited to um to the news articles right and it wouldn't give us that data and that's actually good because we don't want LM to hallucinate something it does it doesn't know right so what I'm going to do here is I'm going to enhance the entities so uh what it will do is like originally we don't have any information about you know like the The Entity such as I just saw like probably apple is also mentioned or Nvidia is also mention but we want to know more like holistically like comprehensive information about it and okay okay okay so this is a bigger graph um I'm not going into detail about like the specific notes but if I ask the same question and here you can see rag mode I'm changing changing from Vector only to Vector plus kg I'll explain that in a bit but let's ask the same question again media such as competitors suppliers okay let's wait for it okay so you see that this is returning this and this will only happen when this like you you have the rag mode like the the retrievals are like fetching both from on structure Theta which is Vector based based on Vector similarity search the most mainstream um rack uh backbone and the kg1 which is extracting information from structure data so if you inspect the context data like what it's uh extracting from what it's retrieving from you you would see all these other new information being fed such as Nvidia has a partnership with of course a lot of companies in the industry like has different class classification has CEO Jensen ju of course and then has competitors here suppliers and it also reference to some of the news articles we just imported so this is just a small demo of like like if you know s okay sorry yeah you have a question Define what kind of relationship you looking for or how does this exactly work yes so um that's a good question we definitely need to predefine such as like uh Nvidia it's like organization or something we there's like different machine learning models behind it to kind of discern like what type of like entities or relationships it is um but like like for example you you would say like apple apple it's not just an organization they could be like a you you know other entities I have to think of it but but I will show you later but yeah right now this is based on like the predefined um like a like ontologies and relationships like oh like like what it should be the relationship should be such as like the suppliers the competitors yes it it's pretty defined inter yes it's it's pull from the internet real time so like I just import articles right it's like importing uh literally the the microchip to hold on like when I hit the import articles previously 10 articles is pulling the most recent articles regarding the video did it the internet again when you wanted to enrich uh it no no no so so uh cuse like uh this across the entire internet we organize information so we have our like the you know information s Nvidia competitor suppliers in our there's already some data there yeah yeah so so let me show you what it actually looks like it's it's basically like Wikipedia um if you go on to Wikipedia you can see there's a sorry so so for example if I search uh name Nvidia okay oh sorry wrong case Nvidia search okay so this is basically like when I hit the enhance button this is the information that is being pulled from like summary and headquarters uh like f funding rounds or like uh the the key people here is subsidiaries basically what you just see and the no relationships are being P pulled from here yeah any other questions I I would like if you guys have any questions just raise my hand I love to be interrupted question okay okay oh yeah yeah hello yeah it's nice to keep me exercising while presenting so down 10 articles and then this other screen you're showing that's what generated when you hit the um you like natural language processing or something like that there yes this screen is processing that data organizing it and then you furry it and your model tells it to look in this natural language output yes exactly so summar just to summarize a little bit it's like I import articles and because in in the articles for example this um you you know like they are like in Nvidia like how streamline there's like some relationships in the Articles and if we want to read every articles like with human eyes to understand it's too timec consuming so we we use our NLP API to like extract the entities um and and relationships so it becomes a graph like we load it into NE forj does answer your question okay okay nice I questions go ahead how difficult is it to the mod to identify some new relationships which are not predefined by you and I necessary for specific um that that's a good question U that's related to the NLP API um I'm going to show that later so I'll remember your question if I don't yeah okay another question yeah okay I actually like finding uh would you be able to provide your own unstructured data such as a conversation and have it build a graph from that yes okay I I think that's related to your question so you know what I'm going to switch a little bit of the agenda and uh show you guys like what exactly what I me men um wait a second let me find okay so MP demo I want to do this like interactively so anyone could volunteer uh giving me a paragraph like any type of paragraph you have and we're we're going to do like real time wait can I we're going to do real time Knowledge Graph Construction can we get the quarterly report of Airbus so like there's a bunch of text in there uh Airbus did you just say yeah Airbus the the aircraft company oh you want to find Airbus airb the the quarterly report quarterly report yeah yes yes we go so C are are you saying that se SEC filing that type of thing okay um you know what I yeah I can do that but I'm just afraid that my time is running out I how about I I'll go after to your like more specific uses but I want to uh yeah anyone want to kind of send me some text no okay I'll go on Wikipedia find my own so let's say we want to because I I just saw YouTube here uh YouTube Wikipedia because that why is it Wikipedia okay so let's say we um copy this text and okay okay so so this is some uh Al a demo that we here I'm going to replace this text because I'm curious about YouTube and just give this some more time sry okay so you see I just copy any unstructured data it's a like a summary of of YouTube and it created knowledge W like it extracted it identify the different um entities here so related to someone asked earlier like um like the predefined ontology yes it's currently under predefined but you can see that YouTube like it it's it could be fit under different types of categories as you can see here know yeah so so this is uh related to someone that just asked like this basically I just constructed a Knowledge Graph using uh the our NLP API anyone had like is there any other questions oh go ahead sure do it work huh does it work for instance with uh Healthcare data to uh extract um uh symptoms and um extract relationships between yeah things in heare yeah so can you give me just one like a random um like a medical term the longer the better like like the rare the better I'm going to show you yeah is there a term that tell tell me how to spell it and um maybe just take the Wikipedia article for citis or something okay what's that or some some disease okay I probably need to learn English first res okay okay res oh good good W MD okay let's do ity is that Val Source let's copy this text and do again letra oh no no no okay just close it on potentially submit sorry I have a few seconds I think I'm over time right it's good oh yeah we we uh we scraped the uh images from the internet and store in our data center yes anyone questions yeah welcome so you see is this related to yeah yeah it can it can um identify so actually if I click on this it it's like well actually this is another term in longra like we're doing entity link is like we have this identity in our graph like we know what it is including the different names in in other languages too so is that yeah I know um I have a question about how do you validate those relationship you have identified are correct um in the Nvidia example I think in the supplier list some of them don't look like suppliers they look like customers so I'm curious I'm curious how you validate the results okay so um actually you know what let me do this so show me um uh suppliers of Nvidia that are also customers right at the same time let's see okay something's wrong here partnership what's uh have has suppli okay yeah so I probably didn't en yeah I didn't enrich all of them but but that's a valid question like like if um I can later do like so so the another thing about knowledge D is like if this this entity like that happens to have multiple relationship at same for example no wor for example like suppliers and customers at the same time that it could identify return that but and your questions is very valid it's like yeah how do we how do we have like a common like consensus as like oh is this relationship universally um acceptable right um well we that there's definitely some outliers and long terms that I'm not going to lie about that or we can handle like everything correctly but like this is pretty much like a common sense like basically we try what we where we're trying to do at this Bo we verify information from Mo very various source and basically we have confidence s scores of like the information yeah yeah so how do you how do you get the relationship like how how do you you could pay def relationship world you in [Music] yes yes but then now um how do you uh have the optimal relationship yeah so this is related to this ladi's question is um well like well there there's s like various machine learning models working behind the scene like they were do some kind of like calculation and see okay this this is probably the most um like um ithen ified or agreeable relationship for so we use that and and I want to kind of like like um emphasize this is your your knowledge graph and I know people from Neil lator will probably talk about this too Knowledge Graph is basically how you want to organize your data to result like to to have the best performance to whatever uh tax you're solving here so like we're doing like a more General thing and then you can definitely uh redefine like if it's not yeah and yeah so a lot of machine learning models such just like little yeah h oh that's a good question no so pre-m we have been doing this pre-m the NLP the natural language processing stuff and the results will be deterministic because it's under like a fixed schema and that's something that U right right now if people want to use LM to do knowledge construction knowledge gra construction they will face is like every time you do in like a unstructed unstructured text even if it's the same it will generate different results yeah any other yeah so we we probably have time for two more questions right because we'll need to move on so please you know ask a question and put a lot of thought into it sure so I have two very quick questions the first one being um so our start startup uses new 4J quite often I'm curious to know um which model do you think works very well for you when it comes to categorizing the data categorizing data what do you mean by categorizing so let's say for example you have different nodes and relationships and all the text is uh typically unstructured so what model do you think works best for you when it comes to structuring that data and putting it into the knowledge graph well so I I would always I want to go back to like for knowledge Drive construction it always goes back to what type of task what type of um problems you're trying to solve right because different domains they have they would have different you know ontology like as graph people would say but like for us like we we want to provide data for like some like for example like data analyst data scientists and and that's like more Universal so the the models um we we don't like the what you're seeing here is not LM power what like we're working to was like integrating but the the models are more like natural language processing and entity linking and a lot machine learning models okay so you're not using let's say open ey API to kind of categorize the data okay and my follow-up question is um essentially is this a is this similar to just a coign similarity for your vector database combined with a Knowledge Graph yeah so because as I mentioned like Neo J like on they you know there's a property graphic you can store embeddings of that entity under the note and like for example we we search through articles and it's doing Vector similarity search thank yes thanks and so sorry if I missed this earlier I wanted to hear because there's use cases I'm I know of in our situation and and I'm sure many uh where it goes out to the web it gathers information based on that information it's enriched and then there could be a secondary or multi-step you know Gathering of information to the web is that is that a functionality of this now today or is that yeah so uh we uh of of course like we uh specifically designed this demo like basically we're calling APN and to say okay like we first import articles and you know do the NLP stuff and then enrich some of the metadata and do a rack thing right um well we can talk more about this this is like a open source GitHub then does it go back into the web and then gather the information uh if you call it if you want to do real time yeah yeah all right I think maybe one more question and yeah yeah and we'll have some time after the talks uh to mingle this time so hopefully you know will hang out and can yes go ahead yeah my name is Deval I I mean for the presentation this uh example of extracting data from news article is great but where do you where do you think this would be best served because to me I'm looking at this example and I'd be like hey I'll probably just go on Google to get the supplier list I might even go to FBI's J Edgar Hoover whatever that database is right and uh I and I love that question about validation how do you validate the data that's been extracted so uh where do you think what would be like in the real world what would be the best place like this software would serve best yeah so what what we what I just showed to you is like just just like a subset of the demos like um our our apis like we're grabbing for example a lot of um people want to web scrap they want to initially they they go to python beautiful scripts cenan driver just to scrape the data from that website and we we like what we offer mainly is it's like you enter uh you enter any URL and it's script it for you and you have a CSU file and also of course like the metadata that you're seeing here I mean the validation part because we we um serve like data science and data analysis and we care to okay what's the information that's most helpful you know like people are doing Market an Market uh analysis and want to make sure that information are factual and helpful to them so that's the the the relationships that like agreeable that I I can talk more about that to you but this is just a demo this is not what we do yeah yeah thank you and um so anyone like if you feel like okay I still kind of don't don't know like what this actually do um you can go on thot.com well we we um we will we give everyone a free token so you can play around and and like you don't you don't have to um con be concerned about to uh the the cost if you're just like okay I want to see what this is this is about yeah thank you thank you so much appr