Join the conversation

Join the community of Machine Learners and AI enthusiasts.

Sign Up
louisbrulenaudet 
posted an update Sep 8
Post
1573
An example of the application of LegalKit is the production of knowledge graphs, here is a demo Space 🔗

With the update of the French legal code data model uploaded to 🤗 and the introduction of a column dedicated to HTML text, it's now easy to extract links between different articles and produce complex graphs with just a few lines of Python.

This simplified demo highlights the ease of implementation and creative potential, and enables the generation of complete data sets, although requiring a powerful graphics card for display. The framework used for the moment is D3.js, but perhaps other solutions are possible. I'd be delighted to hear your suggestions, and look forward to hearing from the community.

Link to the 🤗 Space: louisbrulenaudet/legalkit-knowledge-graph

i find knowledge graphs very interseting : as today the models are making very detailed knowledge graphs which actually are unusable !

so we should be refineing these graphs to contain the specfic entitys we are concerned wiith:

So if we create a knowledge graph of evidence for instance , we may only wish to work with the subtree of Murder Weapo ! .... Or a subtree of a specific person !

this gives i a knowledge about that entity !

SO in truth we do not need the whole tree which can also produce unwanted predictions ( hallecenation ) or in correct prediction due to the data being oversaturated !.

The knowledge graph situation is very valuable to interpret large documents as well as develop large documents and summary ! as given a overal pwerspective of content and the specific entity required a summary can be written which contain the truth inside the tree ... based on the content (rag summarys ) provided !
For me i dont load rag sumarys in to my RAG ! I upload CONTENT! ....

NOw i feel the content actually has no value ! as your only feeding a prompt with some accompaniyingn ststements , which may or not be relevant !
Instead i have devised that saving masked data is better !

SO if we save masked data sentences , in which the entitys are removed ! then we can now save entity trees also ... the model should be able to recontruct information in from the tree with any collection of MAsked sentences !

in fact it is my belief after one conversation with the model that this is actually how data is stored ! << the masked sentences only contain gramatical usage of language , hence any entiityt can be plugged intot the sentences : hence it can produce any past shape with any entity implants !

the boy jumped over the _ or even ___ JUMPED OVER ____ hence any word ca be pla ed in the object or subject location ! it kinda like the snowball algo !
So if we prepend that we should only be saving Masked sentences and knowledge tres about specific entitys then we can always contrcut any sentence ... based on its activty !

because the knowledge tree is what is actuall holding the data ....so based on a masked sentence and a graph or entity tree , we can fid the most probable matches .... SO in this it can produce Highly likely Hallcenation ! as in changing some entitys it becomes truth !

as data and sequeces are past shapes ! it only selects if as the most probable statitical combo !

SO : Refined kowledge graphs containing just the graph associated with the target entity and the ( masked prases which you wish to know information about ) or the likelyhood of these entity tree Fitting these masked sentences ,,

____ KILLED _____ with _____ in the ____

SO given a tre about John in the kithen as the cheif we can see if indeed he fits that patern in the overall knowldge base of entitys and evidence (non masked sentences ) hence we can determine truth by creating hallucenations and checking the statistical value of the constructed sentence !

Hmmmmm Something to think about : in how to actually use these knowledge graphs as in scenarios in which they have actually been used sucessfully the trees were NOT super detailed !

Nice! How do you make the graph itself?