Spaces:
Runtime error
Runtime error
namberino commited on
Commit ·
3143219
1
Parent(s): bb0a982
Tune the difficulty estimator's distractor penalty
Browse files- generator.py +2 -2
generator.py
CHANGED
|
@@ -1038,8 +1038,8 @@ class RAGMCQ:
|
|
| 1038 |
# penalties: if distractors are extremely close to correct -> higher penalty
|
| 1039 |
too_close_count = sum(1 for s in sims_mapped if s >= 0.85)
|
| 1040 |
too_far_count = sum(1 for s in sims_mapped if s <= 0.15)
|
| 1041 |
-
distractor_penalty = min(1.0, 0.5 * mean_sim + 0.
|
| 1042 |
-
amb_flag = 1.0 if top >= 0.
|
| 1043 |
except Exception:
|
| 1044 |
mean_sim = 0.0
|
| 1045 |
distractor_penalty = 0.0
|
|
|
|
| 1038 |
# penalties: if distractors are extremely close to correct -> higher penalty
|
| 1039 |
too_close_count = sum(1 for s in sims_mapped if s >= 0.85)
|
| 1040 |
too_far_count = sum(1 for s in sims_mapped if s <= 0.15)
|
| 1041 |
+
distractor_penalty = min(1.0, 0.5 * mean_sim + 0.2 * (too_close_count / max(1, len(sims_mapped))) - 0.2 * (too_far_count / max(1, len(sims_mapped))))
|
| 1042 |
+
amb_flag = 1.0 if top >= 0.9 else 0.0
|
| 1043 |
except Exception:
|
| 1044 |
mean_sim = 0.0
|
| 1045 |
distractor_penalty = 0.0
|