Find answers from the community

Updated 2 months ago

I'm trying to use GPT4 to rank document

I'm trying to use GPT4 to rank document summaries. For each document I have the document itself and several summaries. Is there a way to throw this directly into LLMRerank without going through a retrieval step? The tutorials all have the process of building a vector index and doing a retrieval step prior to reranking - I'm hoping to avoid that and go directly to reranking
L
1 comment
You can use the reranker directly yes

Plain Text
from llama_index.core.schema import NodeWithScore, QueryBundle

query_bundle = QueryBundle("query")
nodes = [NodeWithScore(node=node, score=1.0) for node in existing_nodes]

reranked_nodes = 
reranker.postprocess_nodes(nodes, query_bundle=query_bundle)
Add a reply
Sign up and join the conversation on Discord