(text: str)
| 4151 | |
| 4152 | def _looks_like_extraction_noise(text: str) -> bool: |
| 4153 | cleaned = _clean_text(text) |
| 4154 | if not cleaned: |
| 4155 | return False |
| 4156 | lowered = cleaned.lower() |
| 4157 | noise_markers = ( |
| 4158 | "arxiv:", |
| 4159 | "[cs.", |
| 4160 | "correspondence to:", |
| 4161 | "copyright", |
| 4162 | "accepted by", |
| 4163 | "proceedings of", |
| 4164 | "doi:", |
| 4165 | ) |
| 4166 | marker_hits = sum(1 for marker in noise_markers if marker in lowered) |
| 4167 | short_line_count = sum(1 for line in cleaned.splitlines() if 0 < len(line.strip()) <= 18) |
| 4168 | digit_ratio = sum(ch.isdigit() for ch in cleaned) / max(1, len(cleaned)) |
| 4169 | return marker_hits >= 2 or short_line_count >= 6 or digit_ratio > 0.12 |
| 4170 | |
| 4171 | |
| 4172 | def _append_template_qa_block( |
| 4173 | lines: List[str], |
no test coverage detected