(a: str, b: str)
| 259 | |
| 260 | |
| 261 | def title_similarity(a: str, b: str) -> float: |
| 262 | a_norm = normalize_title(a) |
| 263 | b_norm = normalize_title(b) |
| 264 | if not a_norm or not b_norm: |
| 265 | return 0.0 |
| 266 | if a_norm == b_norm: |
| 267 | return 1.0 |
| 268 | words_a = set(a_norm.split()) |
| 269 | words_b = set(b_norm.split()) |
| 270 | if not words_a or not words_b: |
| 271 | return 0.0 |
| 272 | return len(words_a & words_b) / len(words_a | words_b) |
| 273 | |
| 274 | |
| 275 | def publication_quality_score(record: dict[str, Any]) -> int: |
no test coverage detected