evidence_fetcher.TfidfEvidenceRanker

class evidence_fetcher.TfidfEvidenceRanker[source]

Small standard-library TF-IDF ranker for title and snippet text.

Feedback reranking uses a Rocchio-style query update. The original query vector is retained with weight 1.0, MORE/RELEVANT feedback moves the query toward marked evidence with weight 3.0, LESS moves it away with weight 2.5, and IRRELEVANT moves it away with weight 3.0. UNSURE is retained by the caller but has no ranking weight.

__init__()

Methods

__init__()

rank(query, evidence)

rerank(query, evidence, feedback)

Rank evidence after applying explicit relevance feedback.