fix: relax ocr noise classification

This commit is contained in:
Codex
2026-05-04 10:29:05 +08:00
parent 71e708c49c
commit ee6f2d0c4f
+7 -3
View File
@@ -1023,14 +1023,18 @@ class ReviewService:
return False
if PDF_PAGE_NOISE_PATTERN.fullmatch(normalized):
return True
lowered = normalized.lower()
decoration_cues = ("page ", "pdf ", " pdf", "sample", "footer", "header", "for extraction", "copyright", "appendix")
if any(cue in lowered for cue in decoration_cues):
return True
if re.fullmatch(r"[-_/\\|·•\s\d]+", normalized):
return True
if len(normalized) > 80:
return False
word_count = len(re.findall(r"[A-Za-z0-9\u4e00-\u9fff]+", normalized))
if word_count > 8:
return False
if any(marker in normalized for marker in PDF_TEXT_MARKERS):
return False
return True
return word_count <= 2 and len(normalized) <= 18
def _looks_like_platform_review_report(self, value: str) -> bool:
marker_hits = sum(1 for marker in REPORT_PDF_MARKERS if marker in value)