(row: Dict[str, Any])
| 213 | |
| 214 | |
| 215 | def paper_identity(row: Dict[str, Any]) -> str: |
| 216 | explicit_identity = str(row.get("paper_identity") or "").strip() |
| 217 | if explicit_identity: |
| 218 | return explicit_identity |
| 219 | for key in ("paper_id", "doi", "arxiv_id", "url"): |
| 220 | value = str(row.get(key) or "").strip().casefold() |
| 221 | if value: |
| 222 | return f"{key}:{value}" |
| 223 | return "title:" + normalize_phrase_text(row.get("title")) |
| 224 | |
| 225 | |
| 226 | def build_idf_from_texts(texts: Sequence[Any]) -> Dict[str, float]: |
no test coverage detected