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

RerankerModel的token数量 #55

Closed DiaQusNet closed 2 months ago

DiaQusNet commented 2 months ago

文档里写到supports long passages (more than 512 tokens, less than 32k tokens) reranking 但是使用的时候面对更长的token(大于512)会警告Token indices sequence length is longer than the specified maximum sequence length for this model 请问这个是需要进一步设置还是没问题

shenlei1020 commented 2 months ago

if you use bce-reranker to rank long passages, you have to use BCEmbedding.RerankerModel.rerank method and other usages are not available.

your warning indicates that you did not use BCEmbedding.RerankerModel.rerank.

shenlei1020 commented 2 months ago

for more information, the ranking method used in BCEmbedding.RerankerModel.rerank can achieve ranking long passages for more efficient and effective than other methods. you can check the details from raw code

DiaQusNet commented 2 months ago

Sorry I did't mention that I am usingfrom BCEmbedding.tools.langchain import BCERerank to integrate rerank model in LangChain. After check the codes, i find BCERerank also use RerankerModel.rerank to rerank, so I don't know why the warning occurred.

shenlei1020 commented 2 months ago

the warning you mentioned does not affect the ranking results, and you can ignore that when you use BCEmbedding.RerankerModel.rerank