NIUBOYI»Home › › Chatgpt › 中文 | English
微信扫一扫 分享朋友圈

已有 1697 人浏览分享

[数据分析]    Format method for combining and organizing Q&A content and multi-turn dialogue content in a RAG knowledge base

数据分析 2024-6-21 00:56:351697 0
When preparing a local knowledge base, we usually deal with question-and-answer pairs and multi-turn dialogues, especially in customer service systems. We want RAG to handle rigorous one-question-one-answer interactions, while also hoping it can chat better and understand dialogue content. In this case, we need to process these data at the same time.

Specific method
We use a CSV table as an example; by using group_id to distinguish different dialogue groups, we can easily integrate single-turn Q&A and multi-turn dialogue.

group_idrolecontent
1userHello, what type of music do you like?
1assistantI like listening to pop music. What about you?
1userI also like pop music. Recently I've been listening to Jay Chou's songs.
1assistantI like his songs very much too. His music always has a strong sense of story.
2userDo you like traveling?
2assistantI like traveling, especially going to places I've never been to. What about you?
2userI also like traveling. Recently I'm planning to go to Japan to see cherry blossoms.
2assistantThat sounds great! I've always wanted to go to Japan to see cherry blossoms too.
3userHave you eaten?
3assistantYes, I have. What about you?
4userHello, the weather is really nice today.
4assistantYes, the weather today is very suitable for outdoor activities.

Table explanation
The group_id values 1, 2, 3, and 4 represent different groups. Groups 1 and 2 contain multiple rows of data and represent chat dialogues, while groups 3 and 4 contain only one question and one answer and represent Q&A.
  • WeChat Official Account

  • Scan to Visit Mobile Site

QQ|NIUBOYI ( 京ICP备17025393号 )|网站地图

GMT+8, 2026-10-31 07:19 , Processed in 0.370269 second(s), 37 queries .

POWERED BY NIUBOYIAI! 主理人:NIUBOYIAI  点亮哥

Copyright © 2001-2020, NIUBOYI AI.