23 lines
578 B
Python
23 lines
578 B
Python
from __future__ import annotations
|
||
|
||
|
||
class FollowUpDetector:
|
||
_MARKERS = (
|
||
"что дальше",
|
||
"почему",
|
||
"зачем",
|
||
"а что",
|
||
"уточни",
|
||
"подробнее",
|
||
"как именно",
|
||
"покажи подробнее",
|
||
)
|
||
|
||
def is_follow_up(self, raw: str) -> bool:
|
||
text = " ".join((raw or "").lower().split())
|
||
if not text:
|
||
return False
|
||
if len(text.split()) <= 4:
|
||
return True
|
||
return any(marker in text for marker in self._MARKERS)
|