rahulnyk / knowledge_graph

Convert any text to a graph of knowledge. This can be used for Graph Augmented Generation or Knowledge Graph based QnA
1.19k stars 237 forks source link

"edge" content as "contextual proximity" #17

Open FJGEODEV opened 7 months ago

FJGEODEV commented 7 months ago

Thanks for your intuitive work. I have a question.

When we calculate contextual proximity, you assign

dfg2["edge"] = "contextual proximity"

When I went through every step to visualize graph, there are lots of "Edge" shown as "contextual proximity", not the content LLM generates.

Is there anything I made wrong or not configure correctly? I followed your workflow just changed the input PDF file.

Thanks.

FJGEODEV commented 7 months ago

How can I display some content on Edge instead of word "contextual proximity"

schiffinor commented 5 months ago

I wrote up a fork of this that fixes this issue. Basically what happens is that edges are drawn in alphabetical order from the merged edge list. Thus if the contextual proximity edge comes after the llm edge it gets overwritten/its beneath the contextual proximity edge. I fixed this by making sure that for all llm edges, if edge A->B and B->A exist if one is a contextual proximity edge and the other is a llm edge they are merged. I also improved output a bit. However, workstation is currently out of commission as boot drive failed. Once its back up and running I'll see about uploading it as a fork or something.

FJGEODEV commented 4 months ago

Thanks for your work, just wondering if it's good to upload the updated fork?

schiffinor commented 4 months ago

idrk, theres a public fork on my page with the slight edits I made. check the diffs if you'd like. Also I noticed you can use straight pdfs if you have a bunch of extra modules

FJGEODEV commented 4 months ago

idrk, theres a public fork on my page with the slight edits I made. check the diffs if you'd like. Also I noticed you can use straight pdfs if you have a bunch of extra modules

there are multiple forks, could you point to me which one is that? Thanks.

schiffinor commented 4 months ago

man, I don't really know what to tell you its on my public profile under my repositories. Its a public repository that is called knowledge-graph and says forked from rahulnyk. Not much else I can do than send the link: but, you could have found this easily lol. just click on my profile. https://github.com/schiffinor/knowledge_graph

FJGEODEV commented 4 months ago

OK, I got it. Thanks!