| rank_records | R Documentation |
Sends every record to every model in the ensemble at every replicate,
aggregates the resulting scores per record, and returns the corpus with
the aggregated score and rank attached. Progress is displayed with cli.
All intermediate scores are cached to disk so an interrupted run can be
resumed by calling rank_records() again with the same cache_dir.
rank_records(
records,
criteria,
ensemble = default_ensemble(),
cache_dir = getOption("screenllm.cache_dir"),
verbose = getOption("screenllm.verbose", TRUE),
max_workers = getOption("screenllm.max_workers", 1L),
on_score = NULL
)
records |
A tibble of records (produced by |
criteria |
A |
ensemble |
A |
cache_dir |
Directory to write per-call cache files. If |
verbose |
Show progress messages and bars. |
max_workers |
Not yet used; reserved for future concurrency. |
on_score |
Optional callback invoked once per (record, model,
replicate) tuple after each score is available (whether fresh or
restored from cache). Signature:
|
The input tibble with added columns:
universal_best_score, rank, per_model_scores (list-column),
justifications (list-column of per-criterion rationales as returned
by the LLM).
# A no-Ollama, in-R demo using the mock backend.
records <- data.frame(
id = c("a", "b"),
title = c("Coral reef restoration outcomes",
"Deep-sea mining impacts on benthic fauna"),
abstract = c("We monitored transplanted corals for 12 months...",
"This modelling study estimates long-term sediment plumes...")
)
criteria <- define_criteria(
scope = "Field-based coral reef restoration and performance",
inclusions = c("Study is field-based.", "Study describes an intervention.")
)
ens <- default_ensemble(backend = backend_mock())
ranked <- rank_records(records, criteria, ensemble = ens, verbose = FALSE)
ranked[, c("id", "universal_best_score", "rank")]
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.