From 4800e25dd622ac9760d2b4b09c36cfe6c910ae0a Mon Sep 17 00:00:00 2001 From: q Date: Sun, 19 Apr 2026 13:23:03 +0300 Subject: [PATCH] best: score 0.5541 (recall 0.5759, ndcg 0.4670) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - DENSE_PREFETCH_K 80 → 120 - RERANK_LIMIT 25 → 35 - add question.text as extra dense when differs from search_text Co-Authored-By: Claude Sonnet 4.6 --- search/main.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/search/main.py b/search/main.py index 974fd8f..f3aa8e7 100644 --- a/search/main.py +++ b/search/main.py @@ -162,10 +162,10 @@ async def lifespan(app: FastAPI): app = FastAPI(title="Search Service", version="0.1.0", lifespan=lifespan) -DENSE_PREFETCH_K = 80 +DENSE_PREFETCH_K = 120 SPARSE_PREFETCH_K = 200 RETRIEVE_K = 150 -RERANK_LIMIT = 25 +RERANK_LIMIT = 35 KEYWORD_BOOST_EXTRA = 10 @@ -405,13 +405,16 @@ async def search(payload: SearchAPIRequest) -> SearchAPIResponse: dense_vectors = [dense_vector] extra_texts: list[str] = [] + raw_text = question.text.strip() + if raw_text and raw_text != dense_query: + extra_texts.append(raw_text) for v in (question.variants or []): q_v = v.strip() - if q_v and q_v not in extra_texts: + if q_v and q_v != dense_query and q_v not in extra_texts: extra_texts.append(q_v) for h in (question.hyde or []): q_h = h.strip() - if q_h and q_h not in extra_texts: + if q_h and q_h != dense_query and q_h not in extra_texts: extra_texts.append(q_h) extra_texts = extra_texts[:3] if extra_texts: