Find answers from the community

Updated 4 months ago

Shorter answers

At a glance
Hi, I'm using GPTKeywordTableIndex on the 2020 Summer Olympics dataset from OpenAI.

I kind of get what I want here (not using the prompt template in the actual index call) but the result includes a lot of irrelevant info. I just need "The basketball competitions at the 2020 Summer Olympics were held at two arenas: the Saitama Super Arena in Saitama and the temporary Aomi Urban Sports Park in Tokyo."

What can I do to get that, and should I use a better prompt template to include in the query? Thank you.
Attachment
image.png
L
F
A
7 comments
You can try changing the prompt to say something like "answer in one sentence" or something to indicate you want short answers.

OpenAI models are pretty verbose usually lol
@Logan M Thank you! That seems to make it a lot better. For SimpleVectorIndex, In some cases, when I tell it to print out the context, I notice that the correct info was cutoff somewhere along the lines.

I asked it who are the flagbearers of Canada during the opening ceremony, and it seems to get to the info of ... Malaysia flagbearers. Is using something like similarity_top_k going to get more context into my prompt?
Yea similarity_top_k will help here! You can also try response_mode="compact" to try and reduce calls to the LLM too (by default, it will make one call per top_k)

You could also try playing with the chunk_size_limit during index construction

One last option could be using an NLTK or Spacy text splitter to split at the sentence level

You can use any text splitter from langchain. There's a list of splitters here: https://langchain.readthedocs.io/en/latest/reference/modules/text_splitter.html

Then when you construct your index, you can pass it in with text_splitter=MyTextSplitter() or something like that
Thanks a lot! I'll explore those options. Love your responses here!
Haha thanks! Good luck! πŸ’ͺπŸ’ͺ
Hey Logan, what does differ between chunk_size_limit in the index construction and chunk size in textsplitter?
I'm actually not 100% sure haha
Add a reply
Sign up and join the conversation on Discord