update
This commit is contained in:
parent
ffab2ccdcd
commit
64793795da
@ -79,7 +79,11 @@ class KBESService:
|
||||
chunks, metrics_raw = await cls._es_search(question)
|
||||
retrieve_ms = (time.perf_counter() - t0) * 1000
|
||||
|
||||
chunks, best_cov = cls._rerank_chunks(question, chunks)
|
||||
# KB_PROVIDER=es_bm25 场景:以 ES 返回的原始排序为准(与手工 curl 对齐),不做二次重排。
|
||||
if KBConfig.KB_PROVIDER == 'es_bm25':
|
||||
best_cov = cls._rerank_chunks(question, chunks)[1]
|
||||
else:
|
||||
chunks, best_cov = cls._rerank_chunks(question, chunks)
|
||||
|
||||
top1 = float(chunks[0].get("_score") or 0.0) if chunks else 0.0
|
||||
top2 = float(chunks[1].get("_score") or 0.0) if len(chunks) > 1 else 0.0
|
||||
|
||||
Loading…
Reference in New Issue
Block a user