Config
Configuration data structures and loaders for rubric and role definitions.
The pipeline requires two JSON config files
config/lens_rubric.json: defines the 8 evaluation dimensionsconfig/roles.json: defines the 3 clinical roles with per-dimension weight vectors (w_prior) and optional LLM prompt profile paths
This module parses those files into frozen dataclasses used throughout the scoring and orchestration layers.
Dimension
dataclass
A single rubric evaluation dimension (e.g. "factual_accuracy").
Source code in src/grading_pipeline/config.py
21 22 23 24 25 26 27 28 | |
RoleProfile
dataclass
A clinical role's configuration: identity, weights, and LLM profile.
Attributes:
| Name | Type | Description |
|---|---|---|
id |
str
|
Machine-readable identifier (e.g. "physician", "triage_nurse"). |
name |
str
|
Human-readable role name. |
persona |
str
|
One-line persona description used in LLM prompts. |
w_prior |
Dict[str, float]
|
Per-dimension importance weights, each in [0, 1]. |
prompt_profile |
Dict[str, Any]
|
Optional LLM-specific scoring profile loaded from a separate JSON file (empty dict if not provided). |
Source code in src/grading_pipeline/config.py
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 | |
Rubric
dataclass
The full evaluation rubric containing all scoring dimensions.
Source code in src/grading_pipeline/config.py
31 32 33 34 35 36 37 38 39 40 41 | |
dimension_ids
property
Return ordered list of dimension ID strings.
load_roles(path, dimension_ids)
Load role definitions from JSON, validating weights against the rubric.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str | Path
|
Path to |
required |
dimension_ids
|
List[str]
|
Expected dimension IDs from the rubric, used to detect missing or extraneous weight keys. |
required |
Returns:
| Type | Description |
|---|---|
List[RoleProfile]
|
List of |
Raises:
| Type | Description |
|---|---|
ValueError
|
On missing/extra dimension weights or invalid weight values. |
Source code in src/grading_pipeline/config.py
128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 | |
load_rubric(path)
Load and parse a rubric JSON file into a Rubric instance.
Source code in src/grading_pipeline/config.py
64 65 66 67 68 69 70 71 72 73 74 75 76 | |