Фиксация изменений
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
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)
|
||||
Reference in New Issue
Block a user