Find answers from the community

Updated 2 years ago

I am completely stumped on following the

At a glance
I am completely stumped on following the "Unified Query" guide. Any help would be greatly appreciated! ❤️

I am running 0.6.5, following the /latest/ guide for Creating a Unified Query Framework

I have two issues:
  1. From the guide: root_index = graph.get_index(graph.index_struct.root_id, GPTSimpleKeywordTableIndex) fails as this function has no attribute 'root_id'. I can seemingly get around this by using root_index = graph.get_index(graph.index_struct.index_id), but this doesn't feel right.
  1. After then setting up the Graph, I try to run a query response = query_engine.query("how are you?"), which fails in a ZeroDivisionError: integer division or modulo by zero. (https://pastebin.com/24ja3G2t).
This is my code: https://github.com/jensbech/kazar-llama-index-chatbot/blob/v2/examples/paul_graham_essay/v2.py
L
J
3 comments
  1. does graph.root_index not work?
  1. The simple keyword index just removes all stopwords to find keywords. "how are you?" isn't really a search, and also likely is all stopwords. So after the stopwords are removed, there is nothing left to search with (this could likely be handled more gracefully)
Thank you so much for taking the time. I figured out graph.root_index, and you were also totally right about the GPTSimpleKeywordTableIndex. Much better luck with GPTKeywordTableIndex!
Perfect! That was my next suggestion lol
Add a reply
Sign up and join the conversation on Discord