teememo-eq-bench-ja / data /benchmark.patch
YUGOROU's picture
refactor: patchディレクトリを廃止し差分をdata/に統合 (#4)
067623d
--- a/core/benchmark.py
+++ b/core/benchmark.py
@@ -207,10 +207,15 @@
Considers different criteria sets for standard/drafting vs analysis tasks.
Averages scores for allowed criteria within a task first, then averages these task scores.
Returns (average_score, error_message).
"""
- # Define the specific criteria to include for standard/drafting tasks
- STANDARD_ALLOWED_RUBRIC_CRITERIA = {
+ # Define the specific criteria to include for standard/drafting tasks.
+ # [JA-PATCH Fix-B1] Load from file instead of hardcoding so that the allowed
+ # set always matches whatever keys are in the criteria file (English keys when
+ # running the Japanese edition).
+ # The scoring subset intentionally excludes style markers (boundary_setting,
+ # moralising, sycophantic, etc.) – we keep only the EQ-positive criteria.
+ _EQ_POSITIVE_CRITERIA = {
"demonstrated_empathy",
"pragmatic_ei",
"depth_of_insight",
"social_dexterity",
@@ -218,10 +223,31 @@
"message_tailoring",
"theory_of_mind",
"subtext_identification",
"intellectual_grounding",
- "correctness"
+ "correctness",
}
+ try:
+ with open(C.STANDARD_RUBRIC_CRITERIA_FILE, 'r', encoding='utf-8') as _f:
+ _file_criteria = {
+ l.strip() for l in _f
+ if l.strip() and not l.strip().startswith('#')
+ }
+ # Intersect file keys with the known EQ-positive set so we never
+ # accidentally include style markers even if the file changes.
+ STANDARD_ALLOWED_RUBRIC_CRITERIA = _EQ_POSITIVE_CRITERIA & _file_criteria
+ if not STANDARD_ALLOWED_RUBRIC_CRITERIA:
+ logging.warning(
+ "[JA-PATCH] STANDARD_RUBRIC_CRITERIA_FILE yielded no EQ-positive "
+ "criteria – falling back to hardcoded set."
+ )
+ STANDARD_ALLOWED_RUBRIC_CRITERIA = _EQ_POSITIVE_CRITERIA
+ except Exception as _e:
+ logging.warning(
+ f"[JA-PATCH] Could not load standard rubric criteria file: {_e} "
+ "– falling back to hardcoded set."
+ )
+ STANDARD_ALLOWED_RUBRIC_CRITERIA = _EQ_POSITIVE_CRITERIA
# Define the specific criteria to include for analysis tasks
# Assumes analysis criteria are loaded from ANALYSIS_RUBRIC_CRITERIA_FILE
# We need to load them here or pass them in. Let's load them.
analysis_criteria = []