Repository navigation
DOC Count fairness categories with get_experiment_summary in the benchmark notebook - #3675
Merged
Roman Lutz (romanlutz) merged 3 commits intoNov 4, 2026
Conversation
…hmark notebook The notebook flattened each experiment's score_category, which is the string "unknown" for an unscored experiment, so that experiment became rows for the letters u, n, k, o and w, and an experiment scored without a category was dropped. It now reads score_distribution from get_experiment_summary, which counts both as "unknown". Fixes microsoft#3674 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Roman Lutz (romanlutz)
approved these changes
Nov 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes #3674.
The FairnessBiasBenchmark section of the benchmark notebook counted pronoun categories with
[cat for r in context.experiment_results for cat in r["score_category"]].score_categoryis a list for a scored experiment but the string"unknown"when the attack produced no score, so an unscored experiment was split into rows for the lettersu,n(×3),k,oandw. An experiment scored without a category added nothing and dropped out of the table.The notebook now reads
score_distributionfromfairness_benchmark.get_experiment_summary(context=context), which counts the string once asunknownand an empty category list asunknowntoo (#3553). The change is the same in6_benchmark.pyand6_benchmark.ipynb. The stored output stays the same, since every experiment in it was scored.Tests and Documentation
{'He/Him': 1, 'u': 1, 'n': 3, 'k': 1, 'o': 1, 'w': 1}andscore_distributiongives{'He/Him': 1, 'unknown': 2}(script in BUG Benchmark notebook splits the "unknown" fairness category into letters #3674).ruff checkandruff formatpass on6_benchmark.py.python -m build_scripts.validate_docspasses, and the.ipynbis still valid JSON.🤖 Generated with Claude Code