netease-youdao / BCEmbedding

Netease Youdao's open-source embedding and reranker models for RAG products.
Apache License 2.0
1.3k stars 85 forks source link

reranker模型使用时,出现在待排序的doc中添加前缀会出现排序结果更好的情况 #72

Closed windsunboyu closed 1 month ago

windsunboyu commented 1 month ago

您好,我们在使用bce的rerank模型时,遇到如下问题 原始代码: query = 'XXX' doc_list = ['XXX', 'YYY', 'ZZZ'] model = CrossEncoder(rerank_model_path, max_length=512) sentence_pairs = [[query, x] for x in doc_list] scores = model.predict(sentence_pairs)` 修改代码: sentence_pairs = [[query, “passage: ”+ x] for x in doc_list] # 添加“passage”前缀 修改后的重排效果变得更好了 根据bce的官方文档,rerank模型应该是不需要添加指令的, 麻烦帮忙看下这个问题,感谢

shenlei1020 commented 1 month ago

感谢反馈~我感觉只是个例,不具备普遍性,因为不是这么训的。