Hi guys, quick question about modifying the reranking system. I implemented a couple changes into
_postprocess_nodes
inside of LLMRerank where it gives priority to nodes with a more recent date and a specific subtype. However, since
llm_rerank.py
is directly part of a Python package, I'm having trouble with utilizing the modified file instead of the original version of LLM rerank. Is there either a way to make these same node reranking adjustments in my workflow file or override the original package with my new code? Here is my updated section of the code:
for node, relevance in zip(choice_nodes, relevances):
# date score
date_str = node.metadata.get('date')
date_score = datetime.strptime(date_str, "%Y-%m-%d").timestamp()
# Subtype score
subtype = node.metadata.get('subtype', '')
subtype_score = 1.0 if subtype == "pro report" else 0.0
node_score = relevance + date_score + subtype_score
initial_results.append(NodeWithScore(node=node, score=node_score))