Reranking with ZeroEntropy
import {
rerankWithScorer as rerank,
ZeroEntropyRelevanceScorer
} from "@mastra/rag";
const results = rerank({
results: searchResults,
query: "deployment configuration",
scorer: new ZeroEntropyRelevanceScorer('zerank-1'),
{
topK: 5,
weights: {
semantic: 0.4,
vector: 0.4,
position: 0.2,
},
},
);