correction in generate.py
Browse files- app/recs/generate.py +2 -1
app/recs/generate.py
CHANGED
|
@@ -52,7 +52,8 @@ def _looks_like_garbage(text: str) -> bool:
|
|
| 52 |
if re.search(r"(?:\d[\s\n]+){6,}", text):
|
| 53 |
return True
|
| 54 |
digit_ratio = sum(ch.isdigit() for ch in text) / max(len(text), 1)
|
| 55 |
-
|
|
|
|
| 56 |
|
| 57 |
|
| 58 |
def is_fallback_output(text: str) -> bool:
|
|
|
|
| 52 |
if re.search(r"(?:\d[\s\n]+){6,}", text):
|
| 53 |
return True
|
| 54 |
digit_ratio = sum(ch.isdigit() for ch in text) / max(len(text), 1)
|
| 55 |
+
bullet_count = sum(1 for ln in text.splitlines() if ln.strip().startswith("-"))
|
| 56 |
+
return digit_ratio > 0.35 and bullet_count < 2
|
| 57 |
|
| 58 |
|
| 59 |
def is_fallback_output(text: str) -> bool:
|