Skip to content

About

Research abstract screening with OpenAI Decisions and TypeSafe JEV, with CLI reports and an offline HTML explorer

Resources

Contributing

Stars

2 stars

Watchers

0 watching

Forks

Repository files navigation

Abstract Sift

A local CLI for screening research abstracts against a research-interest text with OpenAI Decisions, TypeSafe JEV, or both. Both mode preserves independent scores and reports agreement and disagreement.

Version 0.1 implements concurrent, resumable scoring, per-request cost accounting, CSV/JSONL exports, and comparison metrics. Both live API integrations passed a two-abstract smoke test; a full ESMO run subsequently completed in 13.31 seconds of scoring time (15.27 seconds wall time) on the user’s account. Treat this as an initial beta, not a guarantee of throughput or screening accuracy. Python 3.11–3.14 on macOS/Linux is the test target; use WSL on Windows.

For detailed usage, see the CLI reference, ESMO full-corpus run guide, and SITC scoring and bundle guide, including coverage checks, budget examples, monitoring, and recovery.

For maintainers preparing the next conference, start with the conference workflow playbook: collection, release bundles, scoring documentation, TRACE annotations, and authenticated Sites with persistent scientist voting. Tagging and voting currently run in the conference Site projects; they are not CLI features.

Conference coverage and bundles

Versioned bundles are separate from the software package. Counts refer to the published snapshots; source abstracts retain their original rights.

Conference Records / full texts Processing status Coverage notes Bundle Unscored TSV Guide
ESMO 2026 4,418 / 4,375 Scored; published bundle contains corpus and criteria Includes late-breaking abstracts; 43 missing texts v2 TSV ESMO
SITC 2026 1,127 / 1,126 Corpus, two-provider scores and offline explorer Includes 19 late-breaking abstracts; one withdrawn entry v1 TSV SITC
ASH 2026 6,376 / 6,376 Corpus, two-provider scores and offline explorer; unchanged solid-tumor criteria Includes six plenary abstracts. Late-breaking abstracts are not included yet (scheduled December 7, 2026). v1 TSV ASH
ACR Convergence 2026 2,995 / 2,988 Unscored corpus and metadata; no oncology criteria applied Includes 22 late-breaking and 17 patient-perspective abstracts; seven withdrawn entries v1 TSV ACR

Each release includes provenance and checksums. The unscored TSVs have the same five fields as the JSONL corpora (id, title, authors, full_text, link); no scores or TRACE tags are included. Plain and gzip-compressed TSVs are attached to each release with TSV_GUIDE.md and TSV_SHA256SUMS. Import IDs as text to preserve leading zeros; quoted fields retain multiline abstract text. ACR requires a new rheumatology-specific research question before scoring. Private TRACE annotations and scientist votes are not included in these release bundles.

Terminal output and progress

Commands default to readable tables. Add --format json (or --json) to retain the complete machine-readable schema. --output-format table|json is also available on every command. show includes readable full text after its score table.

uv run abstract-sift status RUN_ID
uv run abstract-sift cost RUN_ID --format json
uv run abstract-sift compare-runs BEFORE_RUN_ID AFTER_RUN_ID --format table
uv run abstract-sift compare-runs BEFORE_RUN_ID AFTER_RUN_ID --format json > comparison.json

Scoring and resume display one progress bar per selected provider on stderr, updating in place at most four times per second. Bars count successful scores (including local cache reuse) against records with text; missing text and failures are shown separately. A partial run does not falsely show 100% successful scoring. In redirected/nonterminal output, auto mode prints only the final provider snapshot. Use --progress never to suppress it, or --progress always to force terminal animation. Progress never contaminates JSON on stdout. Engine batch-completion messages and the large preflight JSON dump are no longer printed during scoring; estimate remains available separately.

For export, --format csv|tsv|jsonl still selects the file format. Use --output-format json or --json for the export confirmation on stdout. Summary tables prioritize key fields; JSON includes the full details and original numeric precision.

Quick start

From this directory, with uv installed, set your API keys before scoring. Create or edit .env in the repository root:

OPENAI_API_KEY=your_openai_api_key
JEV_API_KEY=your_jev_api_key

Replace the placeholders with your actual keys. Both keys are required for --provider both, as used below. For --provider openai or --provider jev, only that provider's key is needed. TYPESAFE_API_KEY is also accepted for JEV.

Then run:

uv sync
uv run abstract-sift import examples/abstracts.jsonl --corpus demo
uv run abstract-sift estimate --corpus demo --query-file examples/interest.txt --provider both
uv run abstract-sift score --corpus demo --query-file examples/interest.txt --provider both --max-cost-usd 0.05

You can also set the keys as environment variables; existing environment values take precedence over .env. The application reads literal values without executing shell expressions. Keys are never saved in the run database or reports. Do not commit .env. Scoring sends the research interest, abstract IDs, titles, and full texts to each selected provider.

ESMO 2026 example

The versioned corpus release provides 4,418 abstracts, including 4,375 with full text, as a 6.34 MiB gzip-compressed JSONL download. It includes provenance, checksums and a snapshot of the research-interest criteria at release time. The current research-interest criteria cover clinical ADC, adoptive cell therapy (CAR-T, TCR-T, NK, gamma-delta T cells and TILs), bispecific and T-cell engager results in solid cancers with explicit biomarkers.

Follow the ESMO walkthrough to download and verify the corpus, import it, estimate cost, score with either or both providers, inspect disagreements, and generate an offline HTML explorer. Downloads require repository access while this repository is private. The corpus is distributed separately from source code and Python packages; original abstract rights remain with their respective holders.

SITC 2026 example

The SITC 2026 bundle provides 1,127 listing records, including 1,126 full texts and 19 late-breaking abstracts. The one withdrawn entry remains visible with missing text. It includes the complete metadata compilation, import-ready corpus, criteria snapshot, separate OpenAI and JEV scores, an offline explorer, provenance and checksums.

Follow the SITC scoring guide to download and verify the bundle, inspect the saved results without API calls, or reproduce the two-provider workflow. The release uses the same research criteria, relevance rubric and 0.3/0.7 thresholds as the current ESMO workflow. Its pilot and full run cost about $0.20 combined in usage-derived estimates; future costs and scores may differ.

ASH 2026 example

The ASH 2026 bundle contains 6,376 numbered abstracts, all with full text, including six plenary abstracts. Both providers scored every record using the unchanged solid-tumor criteria, explicitly selected for this conference. Late-breaking abstracts scheduled for December 7 are not yet included.

See the ASH bundle and scoring guide for provenance, local bundle verification, exact criteria, reproduction commands and interpretation. TRACE annotations and scientist voting are separate hosted review features.

Your corpus

Import CSV or JSONL with string fields id, title, authors, full_text, link. IDs must be unique. Extra fields are ignored. Empty full texts remain visible as missing_text; oversized texts are flagged, never silently truncated.

uv run abstract-sift import /path/to/abstracts.jsonl --corpus conference
# Write your inclusion/exclusion criteria in interest.txt.
uv run abstract-sift estimate --corpus conference --query-file interest.txt --provider both
uv run abstract-sift score --corpus conference --query-file interest.txt --provider both --max-cost-usd 5

Choose --provider openai, jev, or both. All eligible records are scored unless you explicitly set --limit. --batch-size defaults to 16; conservative context limits may split batches further. --concurrency 4 is per provider. Adjust --rpm and --tpm to your account limits; token throttling starts with conservative byte estimates, then reconciles to reported input usage and adapts future estimates with 25% headroom. Batching adapts to the same observed usage; per-question size checks remain conservative. This is empirical estimation, not an exact tokenizer. Instantaneous scoring of thousands of abstracts is not guaranteed. search provides an immediate local lexical preview, not model relevance scores.

A run ID is printed before dispatch. Use it to inspect or resume:

uv run abstract-sift status RUN_ID
uv run abstract-sift results RUN_ID --view retained
uv run abstract-sift results RUN_ID --view discordant --sort gap
uv run abstract-sift compare RUN_ID
uv run abstract-sift cost RUN_ID
uv run abstract-sift export RUN_ID --format csv --output exports/results.csv
uv run abstract-sift resume RUN_ID --max-additional-cost-usd 1
uv run abstract-sift cost --all

To accelerate an existing run, press Ctrl-C, wait for it to exit, then use resume RUN_ID --max-additional-cost-usd 1 --concurrency 16 --batch-size 32. The allowance is additional spending exposure; choose it deliberately. Resume also accepts --rpm and --tpm for known account limits. Each invocation records its runtime settings, while the query, evidence, models, and scoring rubric remain unchanged.

Ctrl-C preserves completed results and attempts. Resume retries unfinished failures, keeping successful results. Refusals, missing texts, and oversized records require review rather than automatic retry. Exact successful results can be reused across runs with the same evidence, research interest, requested model, and rubric. Returned model IDs are retained; caching requires a matching pinned model ID.

Explore and export results

results now defaults to a readable terminal table. Add --json for the original machine-readable array. Exploration is offline and incurs no model charges.

uv run abstract-sift runs
uv run abstract-sift results RUN_ID --top 25 --page 1
uv run abstract-sift results RUN_ID --top 25 --page 2
uv run abstract-sift results RUN_ID --contains "lung cancer" --sort jev
uv run abstract-sift results RUN_ID --view discordant --sort gap
uv run abstract-sift results RUN_ID --view uncertainty
uv run abstract-sift results RUN_ID --status failed
uv run abstract-sift show RUN_ID ABSTRACT_ID

show displays the title, authors, source link, both scores/statuses, and complete abstract text. Text search matches a case-insensitive substring across the original record. Score sorting defaults high to low; use --ascending for low to high. --sort id and --sort title use alphabetical order. Missing scores stay last. --view retained includes all records except those labeled not relevant by every selected provider. discordant means opposite relevant/not-relevant labels; uncertainty covers differing labels involving review.

Export a spreadsheet-compatible table with scores, labels, statuses, errors, model IDs, evidence hashes, links, and comparison columns:

uv run abstract-sift export RUN_ID --format csv --include-text --output exports/results.csv
uv run abstract-sift export RUN_ID --format tsv --view discordant --sort gap --output exports/disagreements.tsv
uv run abstract-sift export RUN_ID --format jsonl --view retained --output exports/retained.jsonl

Exports accept the same --view, --contains, --status, --sort, --ascending, --low, and --high settings as results. They contain all matching rows, irrespective of terminal pagination. --include-text includes the complete abstract text. Empty selections produce a table with headers. CSV/TSV text that could execute as a spreadsheet formula is escaped; JSONL preserves original text. Terminal scores are rounded to three decimals; exports retain full numeric precision.

Compare screening stability across runs

uv run abstract-sift compare-runs BEFORE_RUN_ID AFTER_RUN_ID
# Save a full report with up to 50 largest score changes:
uv run abstract-sift compare-runs BEFORE_RUN_ID AFTER_RUN_ID --top 50 --format json > comparison.json

This is distinct from compare RUN_ID, which compares OpenAI with JEV within a run. compare-runs compares each provider with itself across two runs and reports label agreement, score changes, rank correlation, transition matrices, and IDs newly excluded or retained. Inspect retained.newly_excluded first for candidates that the faster run dropped. Use show with either run ID to review the source and scores. Matching query, evidence, rubric and provider/model configuration are required; incomplete or changed-returned-model pairs are explicitly excluded. Cached reuse is counted so it does not masquerade as independent stability evidence.

Keep thresholds identical. Missing texts are excluded from retained-set stability metrics. Differences cannot be attributed to batch size alone without controlled repeated runs; a stable result does not establish accuracy.

Interpretation and costs

Defaults label scores at or above 0.7 relevant, at or below 0.3 not relevant, and the middle review. Only records judged not relevant by every selected provider are excluded from the retained view. Failed/missing results remain for review. Scores are not calibrated clinical probabilities. Agreement is not correctness.

Comparison uses only successful paired records from the same run and includes a three-way label matrix, binary agreement, Cohen's kappa, positive/negative agreement, Spearman rank correlation, top-k overlap, and raw score gaps. Mixed returned model builds are rejected for comparison. Scores are never averaged. Binary comparison defaults to 0.5 independently of review thresholds. Undefined metrics are null.

Costs use reported input usage and versioned pricing snapshots, in USD, with integer arithmetic. They are usage-derived estimates, not invoices. Retries have separate ledger entries; timeouts or absent usage retain an unreconciled exposure estimate. Cached local results incur no new request cost. Every resume has an additional allowance, and cumulative costs remain visible.

The dispatch budget reserves a conservative byte-based token estimate before each request. Both mode splits the allowance equally; optional --openai-budget-usd and --jev-budget-usd can reduce those shares. Unused shares are not transferred. This is an application guard, not a provider-enforced billing cap: pricing changes or unexpected billed usage can exceed estimates. OpenAI prompt caching is disabled in this release to avoid unpriced cache writes. Review the API notes before large runs.

Local state and development

Default state: ~/.local/share/abstract-sift, including SQLite snapshots and runs/RUN_ID/{run-summary.json,cost-summary.json,request-usage.jsonl}. Use global --data-dir PATH and --env-file PATH before the subcommand to override. Imported abstracts and queries stay in this private local state; exporting is explicit. Exit codes: 0 complete, 2 partial, 130 canceled, 1 configuration/error. A complete run may still contain missing-text records; always inspect counts.

PYTHONPATH=src python3 -m unittest discover -s tests -v

See CONTRIBUTING.md for the complete test, coverage, offline HTML, and package-validation commands.

Tests use fictional abstracts and mock transports; no keys or paid calls are required. The earlier plan, comparison specification, and cost design include future work beyond this release. No OAuth, settled-invoice reconciliation, or automatic threshold calibration is included. The offline HTML explorer and measured benchmark are described below.

This folder is portable and independent of conference downloader scripts. Conference content and credentials are excluded from version control. The software is licensed under the MIT License, copyright 2026 Valius Sciences. Third-party conference abstracts retain their original rights and are not covered by the software license.

Generate the explorer as a local HTML file

# From this repository:
uv run abstract-sift site RUN_ID --output exports/explorer.html
# Or from its parent folder:
uv run --project abstract-sift abstract-sift site RUN_ID --output abstract-sift/exports/explorer.html

Open the generated HTML directly in a browser. It is one self-contained file with the same purple Valius Sciences interface as the ChatGPT Site: all abstracts, percentage score bars, search and score filters, sticky table headers, scatter tab, CSV export, and full-text modals with expandable author/affiliation details. It needs no server, internet, API keys, or paid model calls. Source links still require internet when clicked.

The generator takes a coherent snapshot of the selected run, includes every record and its full text, and retains missing/failed/not-selected statuses. A running run exports its current progress, not future results. Generate a new file to refresh it. Single-provider runs show the other provider as not selected and have no paired scatter points.

--title, --brand, and --description customize the heading, organization name, and introduction. Defaults use the corpus name and saved research-interest text, so another run never silently inherits the ESMO demo criteria. --force permits overwriting an existing HTML file; otherwise the command refuses to overwrite. Global --data-dir selects another local database. Use --format json for the generation report in scripts.

A local file does not inherit ChatGPT workspace authentication. The access badge says “Local snapshot”; anyone given the file can read the embedded abstracts. Only this run's content is embedded—no credentials, request logs, or unrelated runs. The ESMO snapshot is approximately 23 MB.

UI assets are packaged under src/abstract_sift/web/, based on hosted Site source commit 2af81de753a9fccbe7dfd97abdd584086a85513b. The local generator adapts data loading and local-file history handling without changing scoring. It does not require the original Sites project folder or publishing credentials. When porting hosted UI changes, adapt the five UI assets (index.html, style.css, app.js, format.js, scatter.js) deliberately and rerun the standalone checks before releasing. Hosted TRACE enrichment and voting are separate features: do not copy voting API calls or authenticated dependencies into the network-free offline exporter. See the conference workflow.

node tests/check_site.cjs exports/explorer.html

About

Research abstract screening with OpenAI Decisions and TypeSafe JEV, with CLI reports and an offline HTML explorer

Resources

Contributing

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages