Find answers from the community

Updated 4 months ago

Can i call property graph index extractors directly on a document

At a glance

The community member is trying to use the DynamicLLMPathExtractor from the PropertyGraphIndex library, but is having trouble getting it to work as expected. They tried calling the extractor directly on a document, but only got a node with the document text and no additional nodes or relations. The comments suggest that the community member has tried chunking the document into nodes using a SentenceSplitter, and has also tried different extractors and documents, but is still not getting the expected results.

The community members discuss potential reasons for the issue, such as the choice of language model (Haiku vs Sonnet) and the starting entity types provided to the DynamicLLMPath extractor. They suggest that the Haiku model may be struggling and that some tweaking may be required to get the desired results.

Hi, for PropertyGraphIndex's many extractors (WLOG DynamicLLMPathExtractor), can I call them directly on a Document since they are just transforms? I see that that's whats happening under the hood when I insert them but when I call them directly, I'm just getting a node back with the document text and no additional nodes and relations.
O
L
k
11 comments
Hmm. I did that and it gave empty list for both nodes and relations in the meta data. The same document will insert properly.
Did you chunk the document into nodes first though?
Yup. Ran it through a SentenceSplitter.
I tried to follow the code of from_documents and run_transformations. I’m trying different extractors too and other documents.
Here is a picture of what I'm running
Attachment
image.png
Seems like it ran properly (I see the metadata injected), but it just didn't extract anything -- which is totally possible
Thank you for the clarifications! Very helpful <3! I think I'm just surprised to see that the DynamicLLMPath didn't pick up anything for so many documents that I've been trying.
what LLM are you using? That can play a large role
Haiku right now. I'll try switching to Sonnet to test it. The DynamicLLMPath was also given starting entity types so maybe that is why? Haiku is also worse than Sonnet.
Yea tbh I might expect Haiku to struggle a bit 🤔
might take some tweaking
Add a reply
Sign up and join the conversation on Discord