MCPcopy Create free account
hub / github.com/917Dhj/DeepPaperNote / title_similarity

Function title_similarity

scripts/common.py:261–272  ·  view source on GitHub ↗
(a: str, b: str)

Source from the content-addressed store, hash-verified

259
260
261def 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
275def publication_quality_score(record: dict[str, Any]) -> int:

Callers 2

choose_best_title_matchFunction · 0.85

Calls 1

normalize_titleFunction · 0.85

Tested by

no test coverage detected