Find answers from the community

Updated 4 months ago

Hello we re trying to use our support

At a glance

The community member is trying to use their support chat history, exported to a JSON file, to feed the llama_index. They are wondering how the AI will know the difference between customer questions and chat attendant answers. The community members suggest manually creating Document objects and labeling each one as a "Question:" or "Answer:" to help the AI understand the structure of the data.

Useful resources
Hello, we're trying to use our support chat history (from our database) to feed the llama_index, right now I've exported all the data to a JSON file and put it on the "data" folder (millions of lines). But I was wondering how will the AI know what is the customer question vs what is the chat attendant answer? Is there a way to send like an index for each phrase (QUESTION:, ANSWER:)?
L
M
5 comments
you may need to write your own data loader and add that manually.

It's pretty easy actually! Just load the JSON in python, iterate over it, and manually create Document objects

Full guide on documents here: https://gpt-index.readthedocs.io/en/latest/core_modules/data_modules/documents_and_nodes/usage_documents.html
Thank you Logan, I'll take a look!
Hey Logan, sorry for being annoying, but can u give me one more help?
Like on this sample, how would I fill in a way that AI will know what is a "question" and what is the "answer" for this question?
Attachment
Captura_de_Tela_2023-07-19_as_19.36.44.png
I would make each document a labeled question/answer pair

So you can set the text to be exactly that

Plain Text
Document(text="Question: question text?/n/nAnswer: answer text")
Add a reply
Sign up and join the conversation on Discord