(row: Dict[str, Any])
| 151 | |
| 152 | |
| 153 | def paper_identity(row: Dict[str, Any]) -> str: |
| 154 | explicit_identity = str(row.get("paper_identity") or "").strip() |
| 155 | if explicit_identity: |
| 156 | return explicit_identity |
| 157 | for key in ("paper_id", "doi", "arxiv_id", "url"): |
| 158 | value = str(row.get(key) or "").strip().casefold() |
| 159 | if value: |
| 160 | return f"{key}:{value}" |
| 161 | return "title:" + normalize_phrase_text(row.get("title")) |
| 162 | |
| 163 | |
| 164 | def build_idf_from_texts(texts: Sequence[Any]) -> Dict[str, float]: |
no test coverage detected