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
3 changes: 2 additions & 1 deletion doc/code/scoring/2_float_scale_scorers.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,8 @@
"and evaluate it on independent data before relying on its scores.\n",
"\n",
"This example disables abstention and uses `FloatScaleThresholdScorer` to report both the local\n",
"numeric score and a boolean verdict. The `0.5` threshold is for demonstration; validate it on your own data.\n",
"numeric score and a boolean verdict. The `0.5` threshold is for demonstration; validate it on your own data\n",
"as in [Objective Metrics for Float-Scale Scorers](./float_scale_threshold_metrics.ipynb).\n",
"All scoring below runs locally, without an LLM judge."
]
},
Expand Down
3 changes: 2 additions & 1 deletion doc/code/scoring/2_float_scale_scorers.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,8 @@
# and evaluate it on independent data before relying on its scores.
#
# This example disables abstention and uses `FloatScaleThresholdScorer` to report both the local
# numeric score and a boolean verdict. The `0.5` threshold is for demonstration; validate it on your own data.
# numeric score and a boolean verdict. The `0.5` threshold is for demonstration; validate it on your own data
# as in [Objective Metrics for Float-Scale Scorers](./float_scale_threshold_metrics.ipynb).
# All scoring below runs locally, without an LLM judge.

# %%
Expand Down
3 changes: 2 additions & 1 deletion doc/code/scoring/3_combining_scorers.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,8 @@
"\n",
"`FloatScaleThresholdScorer` wraps a `FloatScaleScorer` and returns True when the\n",
"normalized score meets the threshold. This is the standard way to turn a severity score\n",
"into a pass/fail success criterion. Below it wraps the local `PlagiarismScorer`."
"into a pass/fail success criterion. Below it wraps the local `PlagiarismScorer`. To choose the\n",
"threshold from human-labeled data, see [Objective Metrics for Float-Scale Scorers](./float_scale_threshold_metrics.ipynb)."
]
},
{
Expand Down
3 changes: 2 additions & 1 deletion doc/code/scoring/3_combining_scorers.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,8 @@
#
# `FloatScaleThresholdScorer` wraps a `FloatScaleScorer` and returns True when the
# normalized score meets the threshold. This is the standard way to turn a severity score
# into a pass/fail success criterion. Below it wraps the local `PlagiarismScorer`.
# into a pass/fail success criterion. Below it wraps the local `PlagiarismScorer`. To choose the
# threshold from human-labeled data, see [Objective Metrics for Float-Scale Scorers](./float_scale_threshold_metrics.ipynb).
# %%
from pyrit.score import FloatScaleThresholdScorer, PlagiarismScorer

Expand Down
6 changes: 5 additions & 1 deletion doc/code/scoring/4_scorer_metrics.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,11 @@
"**Which metric matters most?**\n",
"- If false positives are costly (e.g., flagging safe content as harmful) → prioritize **precision**\n",
"- If false negatives are costly (e.g., missing actual jailbreaks) → prioritize **recall**\n",
"- For balanced scenarios → use **F1 score**"
"- For balanced scenarios → use **F1 score**\n",
"\n",
"For a float-scale scorer wrapped in a `FloatScaleThresholdScorer`, all of these metrics depend on the\n",
"threshold. To measure them at every threshold and choose one from human labels, see\n",
"[Objective Metrics for Float-Scale Scorers](./float_scale_threshold_metrics.ipynb)."
]
},
{
Expand Down
4 changes: 4 additions & 0 deletions doc/code/scoring/4_scorer_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@
# - If false positives are costly (e.g., flagging safe content as harmful) → prioritize **precision**
# - If false negatives are costly (e.g., missing actual jailbreaks) → prioritize **recall**
# - For balanced scenarios → use **F1 score**
#
# For a float-scale scorer wrapped in a `FloatScaleThresholdScorer`, all of these metrics depend on the
# threshold. To measure them at every threshold and choose one from human labels, see
# [Objective Metrics for Float-Scale Scorers](./float_scale_threshold_metrics.ipynb).

# %% [markdown]
# ### Harm Metrics
Expand Down
Loading
Loading