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

Function candidate_priority_score

scripts/common.py:288–306  ·  view source on GitHub ↗
(record: dict[str, Any])

Source from the content-addressed store, hash-verified

286
287
288def candidate_priority_score(record: dict[str, Any]) -> int:
289 source = normalize_whitespace(str(record.get("source", ""))).lower()
290 source_url = normalize_whitespace(str(record.get("source_url", ""))).lower()
291 doi = normalize_whitespace(str(record.get("doi", ""))).lower()
292 joined = " ".join([source, source_url, doi])
293
294 if "10.20944/preprints" in joined or any(token in joined for token in PREPRINT_HINTS):
295 return 0
296
297 if record.get("doi") and publication_quality_score(record) >= 2:
298 return 4
299
300 if record.get("arxiv_id") or source == "arxiv" or "arxiv.org" in source_url:
301 return 3
302
303 if record.get("pdf_url"):
304 return 2
305
306 return 1
307
308
309def extract_arxiv_id(paper_ref: str) -> str | None:

Callers 1

choose_best_title_matchFunction · 0.85

Calls 2

normalize_whitespaceFunction · 0.85

Tested by

no test coverage detected