Heuristic filter for personal / lab homepages used in cold start.
(url: Any)
| 1146 | |
| 1147 | |
| 1148 | def looks_like_homepage_url(url: Any) -> bool: |
| 1149 | """Heuristic filter for personal / lab homepages used in cold start.""" |
| 1150 | candidate = str(url or "").strip() |
| 1151 | if not candidate: |
| 1152 | return False |
| 1153 | lowered = candidate.casefold() |
| 1154 | if "scholar.google." in lowered: |
| 1155 | return False |
| 1156 | blocked_markers = ( |
| 1157 | "arxiv.org", |
| 1158 | "openreview.net", |
| 1159 | "doi.org", |
| 1160 | "science.org", |
| 1161 | "nature.com", |
| 1162 | "cell.com", |
| 1163 | "pnas.org", |
| 1164 | "pubmed", |
| 1165 | ".pdf", |
| 1166 | "/abs/", |
| 1167 | "/pdf/", |
| 1168 | "/doi/", |
| 1169 | "/article/", |
| 1170 | ) |
| 1171 | return not any(marker in lowered for marker in blocked_markers) |
| 1172 | |
| 1173 | |
| 1174 | def extract_homepage_url(text: Any) -> Optional[str]: |
no outgoing calls
no test coverage detected