Update app.py
Browse files
app.py
CHANGED
|
@@ -78,7 +78,23 @@ def classify_and_score(
|
|
| 78 |
target_dok: str,
|
| 79 |
agg: str = "max"
|
| 80 |
) -> dict:
|
| 81 |
-
"""Classify a question against Bloom’s and DOK targets and return guidance.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 82 |
res = classify_levels_phrases(
|
| 83 |
question,
|
| 84 |
BLOOMS_PHRASES,
|
|
|
|
| 78 |
target_dok: str,
|
| 79 |
agg: str = "max"
|
| 80 |
) -> dict:
|
| 81 |
+
"""Classify a question against Bloom’s and DOK targets and return guidance.
|
| 82 |
+
|
| 83 |
+
Args:
|
| 84 |
+
question: The question text to evaluate for cognitive demand.
|
| 85 |
+
target_bloom: Target Bloom’s level or range. Accepts exact (e.g., "Analyze")
|
| 86 |
+
or plus form (e.g., "Apply+") meaning that level or higher.
|
| 87 |
+
target_dok: Target DOK level or range. Accepts exact (e.g., "DOK3")
|
| 88 |
+
or span (e.g., "DOK2-DOK3").
|
| 89 |
+
agg: Aggregation method over phrase similarities within a level
|
| 90 |
+
(choices: "mean", "max", "topk_mean").
|
| 91 |
+
|
| 92 |
+
Returns:
|
| 93 |
+
A dictionary with:
|
| 94 |
+
ok: True if both Bloom’s and DOK match the targets.
|
| 95 |
+
measured: Dict with best levels and per-level scores for Bloom’s and DOK.
|
| 96 |
+
feedback: Brief guidance describing how to adjust the question to hit targets.
|
| 97 |
+
"""
|
| 98 |
res = classify_levels_phrases(
|
| 99 |
question,
|
| 100 |
BLOOMS_PHRASES,
|