wxywb / history_rag

841 stars 109 forks source link

关于非历史文本的输入 #63

Open berwinye opened 6 months ago

berwinye commented 6 months ago

我想利用这个模型做一个别的知识领域的rag。但是我改了提示词和build的文本。如下:

文本: When Madison was growing up, she was a difficult child. “She was very

intense and moody. She would flip at the switch of the light—unpre￾dictable. When she was good, she was very good, but when she would

have those episodes of in-your-face hostility, living with her was very

hard.” Madison, as described by her mother, was very intelligent and was

in the gifted and talented program. She excelled in high school and

但是ask后显示Empty Response,debug后发现这个文本没有build上。故想请问如何操作能build上。

wxywb commented 6 months ago

发我一个sample文本?

berwinye commented 6 months ago

xiao.txt

wxywb commented 6 months ago
  1. 修改cfgs/config.yaml https://github.com/wxywb/history_rag/blob/ea66d21129ad22ae37375f11fd86f96172354bc3/cfgs/config.yaml#L5 因为你的文本是英语的,所以要改为BAAI/bge-base-en-v1.5

2.因为你的格式与我的历史文档完全不一样,所以不能使用特殊设计的切文本方式 https://github.com/wxywb/history_rag/blob/ea66d21129ad22ae37375f11fd86f96172354bc3/executor.py#L29 修改为

from llama_index.node_parser import SentenceWindowNodeParser

3.替换 https://github.com/wxywb/history_rag/blob/ea66d21129ad22ae37375f11fd86f96172354bc3/executor.py#L123

         self.node_parser = SentenceWindowNodeParser.from_defaults(
wxywb commented 6 months ago
截屏2024-04-07 下午3 04 01