md表格细胞值提取加固+replied子串包含过滤 CUDA Torch 安装 2>&1
This commit is contained in:
+13
@@ -1499,6 +1499,14 @@ class MessageMonitor:
|
||||
|
||||
# 提取 md 标记前的用户文本
|
||||
if md_start > 2:
|
||||
# 如果 md 标记是 | 且前一个字符非空白 → head 是表格细胞值,不是用户提问
|
||||
skip_head = (
|
||||
md_start < len(text)
|
||||
and text[md_start] == '|'
|
||||
and md_start > 0
|
||||
and not text[md_start-1].isspace()
|
||||
)
|
||||
if not skip_head:
|
||||
head = text[:md_start].strip()
|
||||
# 去掉尾部状态标记
|
||||
head = re.sub(r'\s*(?:[A-Za-z0-9]~)+\s*$', '', head).strip()
|
||||
@@ -2067,6 +2075,11 @@ class MessageMonitor:
|
||||
if self._fuzzy_duplicate(ts, replied, threshold=0.85):
|
||||
logger.debug(f"[{platform}] 回复模糊跳过: {ts[:50]}")
|
||||
continue
|
||||
# _replied_texts 子串包含:OCR 提取的 md 表格细胞值(如"依赖插件可选/必选")
|
||||
# 是 bot 回复表的一部分,不是用户提问。长度>5才检查避免误杀短消息。
|
||||
if len(ts) > 5 and any(ts in r for r in replied):
|
||||
logger.debug(f"[{platform}] 回复子串包含跳过({len(ts)}c): {ts[:50]}")
|
||||
continue
|
||||
if ts in seen:
|
||||
continue
|
||||
# 模糊匹配:OCR 输出每次微小差异(勖彐碎片、行首数字、尾部截断)
|
||||
|
||||
Reference in New Issue
Block a user