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)
|
scored = await _score_chunks(call_llm, chunks, normalized, sub_questions, plan)
|
||||||
selected = _select_chunks(chunks, scored, plan, keyword_tokens)
|
selected = _select_chunks(chunks, scored, plan, keyword_tokens)
|
||||||
key_facts = _key_fact_lines(summary_lines, 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)]
|
metric_facts = [line for line in key_facts if re.search(r"\d", line)]
|
||||||
if hottest_facts:
|
if hottest_facts:
|
||||||
metric_facts = hottest_facts
|
metric_facts = hottest_facts
|
||||||
@ -1016,7 +1016,10 @@ def _extract_hottest_facts(lines: list[str], question: str) -> list[str]:
|
|||||||
if not lines:
|
if not lines:
|
||||||
return []
|
return []
|
||||||
lowered = question.lower()
|
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 []
|
return []
|
||||||
line = next((item for item in lines if item.lower().startswith("hottest:")), "")
|
line = next((item for item in lines if item.lower().startswith("hottest:")), "")
|
||||||
if not line:
|
if not line:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user