paper_firehose.commands.rank

Rank command: compute and write rank scores into papers.db (rank_score).

Initial minimal version

  • Read per-topic ranking config (query, model).

  • Fetch entries with status='filtered' for the topic(s).

  • Compute cosine similarity (Sentence-Transformers) between query and title.

  • Write scores to rank_score (no status change).

Notes

  • If Sentence-Transformers is unavailable or model download fails, the command logs and skips scoring without raising.

Functions

run(config_path[, topic, output_json])

Compute rank scores and write them into papers.db (rank_score).

paper_firehose.commands.rank.run(config_path, topic=None, *, output_json=False)[source]

Compute rank scores and write them into papers.db (rank_score).

Parameters:
  • config_path (str) – Path to main config

  • topic (Optional[str]) – Optional topic name; if None, process all topics

  • output_json (bool) – When True, suppress log noise and return a result dict.

Return type:

Optional[Dict[str, Any]]

Returns:

Result dict when output_json is True, otherwise None.