atlasbot: broaden hottest query detection
This commit is contained in:
parent
2eb726c274
commit
174324824d
@ -266,7 +266,7 @@ class AnswerEngine:
|
||||
scored = await _score_chunks(call_llm, chunks, normalized, sub_questions, plan)
|
||||
selected = _select_chunks(chunks, scored, plan, keyword_tokens)
|
||||
key_facts = _key_fact_lines(summary_lines, keyword_tokens)
|
||||
hottest_facts = _extract_hottest_facts(summary_lines, normalized)
|
||||
hottest_facts = _extract_hottest_facts(summary_lines, f"{question} {normalized}")
|
||||
metric_facts = [line for line in key_facts if re.search(r"\d", line)]
|
||||
if hottest_facts:
|
||||
metric_facts = hottest_facts
|
||||
@ -1016,7 +1016,10 @@ def _extract_hottest_facts(lines: list[str], question: str) -> list[str]:
|
||||
if not lines:
|
||||
return []
|
||||
lowered = question.lower()
|
||||
if not any(term in lowered for term in ("hottest", "highest", "lowest", "most")):
|
||||
if not any(
|
||||
term in lowered
|
||||
for term in ("hottest", "hot", "highest", "lowest", "most", "top", "peak", "loaded", "load", "busy")
|
||||
):
|
||||
return []
|
||||
line = next((item for item in lines if item.lower().startswith("hottest:")), "")
|
||||
if not line:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user