Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 78 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ The configuration system uses a flexible, hierarchical approach supporting diffe

### Configuration Files Structure

- **Main pipeline config**: Controls manuscript processing, AI model selection, and pipeline steps.
- **QC config (`config.qc.yaml`)**: Controls all quality control tests, test metadata, and versioning. Example:
- **Main pipeline config** (`config.dev.yaml`, `config.sample.yaml`): Controls manuscript processing and pipeline step prompts. Each AI step uses a **flat** block with only `model` and shared `prompts` — no per-provider nesting and no sampling parameters in YAML (API defaults apply at runtime).
- **QC config (`config.qc.yaml`)**: Separate schema for quality control tests (still uses provider-specific blocks under `default.openai` / `default.anthropic`). Example:

```yaml
qc_version: "2"
Expand Down Expand Up @@ -230,10 +230,9 @@ test_runs:
- Panel source assignment
- Data availability extraction

2. **Model Configuration**: Configure different models and parameters:
- Multiple providers (OpenAI, Anthropic)
- Various models per provider
- Temperature and top_p parameter combinations
2. **Model Configuration**: Configure models to benchmark (provider inferred from model name):
- OpenAI models (`gpt-*`, `o*-mini`, etc.)
- Anthropic models (`claude-*`) when supported by the benchmark runner
- Multiple runs per configuration

3. **Output and Metrics**:
Expand Down Expand Up @@ -263,6 +262,73 @@ The benchmark system generates several output files:
- Scoring details
- Error information

### Main pipeline YAML shape (v3.3+)

Each AI step declares a **model** and shared **prompts** only. The runtime provider is inferred from the model name (`gpt*` / `o1*` / `o3*` / `o4*` → OpenAI, `claude*` → Anthropic). Top-level `ai_provider` is optional and, when set, must match the inferred provider.

```yaml
# Optional cross-check (inferred from models when omitted)
ai_provider: "openai"

default:
pipeline:
extract_sections:
model: "gpt-5.4-mini"
prompts:
system: |
...
user: |
...

extract_caption_title:
model: "gpt-5.4-mini"
prompts:
system: |
...
user: |
...

extract_panel_sequence:
model: "gpt-5.4-mini"
prompts:
system: |
...
user: |
...

extract_data_sources:
model: "gpt-5.4-mini"
prompts:
system: |
...
user: |
...

assign_panel_source:
model: "gpt-5.4-mini"
prompts:
system: |
...
user: |
...

match_caption_panel:
model: "gpt-5.4-mini"
prompts:
system: |
...
user: |
...

object_detection: # non-AI; unchanged
model_path: "data/models/panel_detection_model_no_labels.pt"
confidence_threshold: 0.25
```

See `config.sample.yaml` for a minimal template and `config.dev.yaml` for the full development prompts.

**Note:** `config.qc.yaml` keeps its own provider-specific layout; only the main curation pipeline uses the flat step schema above.

## Pipeline Steps

The soda-curation pipeline processes scientific manuscripts through the following detailed steps:
Expand Down Expand Up @@ -857,6 +923,12 @@ For any questions or issues, please open an issue on the GitHub repository. We a

## Changelog

### 3.4.1 (2026-07-06)
- **mmqc-utils from PyPI**: Depend on published `mmqc-utils ^0.3.3` instead of a local wheel path so CI and Docker builds resolve the package without a sibling checkout.

### 3.4.0 (2026-07-06)
- **Unified pipeline config**: Main pipeline steps use flat `model` + `prompts` blocks; provider is inferred from the model name. Per-step `openai`/`anthropic` nesting and YAML sampling fields are removed from the main config (QC config unchanged).

### 3.3.0 (2026-06-10)
- **mmqc_utils integration**: Manuscript HTML cleanup and figure image conversion now use `mmqc_utils` (`document_to_html`, `convert_to_bounded_jpeg`) for parity with soda-mmqc; removed legacy HTML normalization and PDF fallback paths.
- **Python 3.12+**: Raised minimum Python to 3.12; Docker and CI updated accordingly.
Expand Down
70 changes: 14 additions & 56 deletions config.dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
##########################################################
include_qc: true
environment: "dev"
# AI provider: "openai" (default) or "anthropic"
# Optional: cross-check runtime provider against models in pipeline steps.
# When omitted, provider is inferred from each step's model name (gpt* → openai, claude* → anthropic).
ai_provider: "openai"
default: &default
pipeline:
Expand All @@ -12,16 +13,8 @@ default: &default
##########################################################
# Updated extract_sections prompts for smolagents implementation
extract_sections:
openai:
# OpenAI-specific parameters remain the same
model: "gpt-5.4-mini" # Can be "gpt-4o", "gpt-4o-mini", or "gpt-5"
temperature: 0.1
top_p: 1.0
max_tokens: 2048
frequency_penalty: 0.0
presence_penalty: 0.0
json_mode: true
prompts:
model: "gpt-5.4-mini"
prompts:
system: |
You are a scientific text analyzer. Your job is EXTRACTIVE COPYING from the manuscript — not summarizing, paraphrasing, rewriting, or generating new text.

Expand Down Expand Up @@ -98,15 +91,8 @@ default: &default
# 2) Extract Individual Captions Step
##########################################################
extract_caption_title:
openai:
model: "gpt-5.4-mini"
temperature: 0.1
top_p: 1.0
max_tokens: 4096
frequency_penalty: 0.0
presence_penalty: 0.0
json_mode: true
prompts:
model: "gpt-5.4-mini"
prompts:
system: |
You are an AI assistant specializing in EXTRACTIVE copying of figure captions from scientific manuscripts.
This is NOT a generative or summarization task: you must copy text exactly as it appears in the input.
Expand Down Expand Up @@ -151,15 +137,8 @@ default: &default
Verify with the verification tool that `figure_caption` and `caption_title` are exact substrings of the input HTML before returning.

extract_panel_sequence:
openai:
model: "gpt-5.4-mini"
temperature: 0.1
top_p: 1.0
max_tokens: 4096
frequency_penalty: 0.0
presence_penalty: 0.0
json_mode: true
prompts:
model: "gpt-5.4-mini"
prompts:
system: |
You extract figure panel structure from the figure caption text ONLY
Output JSON with one object per panel, in strict left-to-right reading order of the caption.
Expand Down Expand Up @@ -197,15 +176,8 @@ default: &default

##########################################################
extract_data_sources:
openai:
model: "gpt-5.4-mini"
temperature: 0.5
top_p: 0.5
max_tokens: 2048
frequency_penalty: 0.0
presence_penalty: 0.0
json_mode: true
prompts:
model: "gpt-5.4-mini"
prompts:
system: |
You are an expert at extracting structured data source information from scientific Data Availability sections.
Your task is to identify and extract information about databases, accession numbers, and URLs into a specific JSON format.
Expand Down Expand Up @@ -308,15 +280,8 @@ default: &default
# 4) Assign Panel Source Step
##########################################################
assign_panel_source:
openai:
model: "gpt-5.4-mini"
temperature: 0.3
top_p: 1.0
max_tokens: 2048
frequency_penalty: 0.0
presence_penalty: 0.0
json_mode: true
prompts:
model: "gpt-5.4-mini"
prompts:
system: |
You are an expert AI assistant for analyzing scientific data organization, particularly for matching source data files to specific panels within scientific figures. Your task is to analyze file lists from source data ZIP files and determine which files correspond to which figure panels.

Expand Down Expand Up @@ -382,15 +347,8 @@ default: &default
# 5) Match Caption Panel Step
##########################################################
match_caption_panel:
openai:
model: "gpt-5.4-mini"
temperature: 0.3
top_p: 1.0
max_tokens: 2048
frequency_penalty: 0.0
presence_penalty: 0.0
json_mode: true
prompts:
model: "gpt-5.4-mini"
prompts:
system: |
You match ONE cropped panel image to the correct entry from a fixed catalog of panels.
Panel labels and panel_caption text were already taken from the figure caption in an earlier step — you must NOT rewrite or improve them.
Expand Down
71 changes: 16 additions & 55 deletions config.sample.yaml
Original file line number Diff line number Diff line change
@@ -1,21 +1,17 @@
##########################################################
# Default Profile
# Default Profile — main pipeline template (v3.3+ flat step schema)
#
# Each AI step: model + prompts only. Provider inferred from model name.
# See README "Main pipeline YAML shape" and config.dev.yaml for full prompts.
##########################################################
default: &default
pipeline:
##########################################################
# 1) Extract Figure Legends and Data Availability Sections
##########################################################
extract_sections:
openai:
model: "gpt-4o"
temperature: 0.1
top_p: 1.0
max_tokens: 2048
frequency_penalty: 0.0
presence_penalty: 0.0
json_mode: true
prompts:
model: "gpt-4o"
prompts:
system: |
# EXTRACTIVE task: copy contiguous spans from cleaned HTML manuscript input.
# figure_legends and data_availability must be exact character-for-character
Expand All @@ -32,15 +28,8 @@ default: &default
# 2) Extract Individual Captions
##########################################################
extract_caption_title:
openai:
model: "gpt-4o"
temperature: 0.1
top_p: 1.0
max_tokens: 4096
frequency_penalty: 0.0
presence_penalty: 0.0
json_mode: true
prompts:
model: "gpt-4o"
prompts:
system: |
# EXTRACTIVE task: copy figure caption verbatim from HTML input.
# figure_caption and caption_title must be exact character-for-character
Expand All @@ -54,15 +43,8 @@ default: &default
# Reinforces extractive one-to-one HTML copy.

extract_panel_sequence:
openai:
model: "gpt-4o"
temperature: 0.1
top_p: 1.0
max_tokens: 4096
frequency_penalty: 0.0
presence_penalty: 0.0
json_mode: true
prompts:
model: "gpt-4o"
prompts:
system: |
# System prompt for panel sequence extraction
# Panel captions must be exact verbatim HTML substrings of the figure caption
Expand All @@ -76,15 +58,8 @@ default: &default
# 3) Extract Data Sources
##########################################################
extract_data_sources:
openai:
model: "gpt-4o-mini"
temperature: 0.1
top_p: 0.5
max_tokens: 2048
frequency_penalty: 0.0
presence_penalty: 0.0
json_mode: true
prompts:
model: "gpt-4o-mini"
prompts:
system: |
# System prompt for data source extraction
user: |
Expand All @@ -95,15 +70,8 @@ default: &default
# 4) Assign Panel Source
##########################################################
assign_panel_source:
openai:
model: "gpt-4o"
temperature: 0.3
top_p: 1.0
max_tokens: 2048
frequency_penalty: 0.0
presence_penalty: 0.0
json_mode: true
prompts:
model: "gpt-4o"
prompts:
system: |
# System prompt for panel source assignment
# Note: any caption text in the inputs is HTML-formatted
Expand All @@ -116,15 +84,8 @@ default: &default
# 5) Match Caption Panel
##########################################################
match_caption_panel:
openai:
model: "gpt-4o"
temperature: 0.3
top_p: 1.0
max_tokens: 2048
frequency_penalty: 0.0
presence_penalty: 0.0
json_mode: true
prompts:
model: "gpt-4o"
prompts:
system: |
# System prompt for matching panel images to captions
# Caption and panel_caption strings are HTML; copy them exactly, including tags
Expand Down
Loading
Loading