Spaces:
Sleeping
Sleeping
Update src/core/QuizEngine.py
Browse filesupdated the system input prompt
- src/core/QuizEngine.py +35 -7
src/core/QuizEngine.py
CHANGED
|
@@ -113,19 +113,47 @@ class QuizEngine:
|
|
| 113 |
|
| 114 |
return None
|
| 115 |
|
| 116 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 117 |
return (
|
| 118 |
f"Act as a Navy Board Examiner.\n"
|
| 119 |
f"Here is a raw text excerpt from Navy documentation:\n"
|
| 120 |
f"'''{context_text}'''\n\n"
|
| 121 |
f"TASK: Generate a single question based on this text.\n\n"
|
| 122 |
-
|
| 123 |
-
f"
|
| 124 |
-
f"
|
| 125 |
-
f"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 126 |
f"OUTPUT FORMAT:\n"
|
| 127 |
-
f"
|
| 128 |
-
f"
|
| 129 |
)
|
| 130 |
|
| 131 |
def construct_grading_prompt(self, question, answer, context_text):
|
|
|
|
| 113 |
|
| 114 |
return None
|
| 115 |
|
| 116 |
+
def construct_question_generation_prompt(self, context_text):
|
| 117 |
+
"""
|
| 118 |
+
REVISED PROMPT: Few-Shot Pattern Matching.
|
| 119 |
+
Includes specific examples to guide the model towards 'Board-Style' complexity.
|
| 120 |
+
"""
|
| 121 |
return (
|
| 122 |
f"Act as a Navy Board Examiner.\n"
|
| 123 |
f"Here is a raw text excerpt from Navy documentation:\n"
|
| 124 |
f"'''{context_text}'''\n\n"
|
| 125 |
f"TASK: Generate a single question based on this text.\n\n"
|
| 126 |
+
|
| 127 |
+
f"EXAMPLES OF DESIRED QUALITY:\n"
|
| 128 |
+
f"1. [Simple Fact] \n"
|
| 129 |
+
f" Text: 'The NSWC is in Maryland.'\n"
|
| 130 |
+
f" Good Question: 'Where are the Naval Surface Warfare Centers located?'\n"
|
| 131 |
+
f"2. [Process/Order]\n"
|
| 132 |
+
f" Text: 'There are five acquisition phases.'\n"
|
| 133 |
+
f" Good Question: 'What are the five acquisition phases?'\n"
|
| 134 |
+
f"3. [Scenario/Application]\n"
|
| 135 |
+
f" Text: 'A significant Nunn-McCurdy Unit Cost Breach is defined as cost growth of 15% over current baseline or 30% over original baseline.'\n"
|
| 136 |
+
f" Good Question: 'What conditions trigger a significant Nunn-McCurdy Unit Cost Breach?'\n\n"
|
| 137 |
+
|
| 138 |
+
f"EXAMPLES OF POOR QUALITY (AVOID THIS):\n"
|
| 139 |
+
f"1. [Lazy/Meta-Reference]\n"
|
| 140 |
+
f" Bad Question: 'What does the text say about the budget?'\n"
|
| 141 |
+
f" Critique: Do not reference 'the text'. Ask about the subject matter directly.\n"
|
| 142 |
+
f"2. [Yes/No or True/False]\n"
|
| 143 |
+
f" Bad Question: 'Is the budget cycle annual?'\n"
|
| 144 |
+
f" Critique: Too easy. Ask 'What is the duration of the budget cycle?' instead.\n"
|
| 145 |
+
f"3. [Administrative Trivia]\n"
|
| 146 |
+
f" Bad Question: 'What document number is listed in the header?'\n"
|
| 147 |
+
f" Critique: Irrelevant to professional qualification.\n\n"
|
| 148 |
+
|
| 149 |
+
f"STRICT RULES:\n"
|
| 150 |
+
f"1. You must base your question on a SPECIFIC SENTENCE in the text.\n"
|
| 151 |
+
f"2. Output the exact quote you used to form the question.\n"
|
| 152 |
+
f"3. If the text is meaningless or 'Intentionally Left Blank', output 'UNABLE'.\n\n"
|
| 153 |
+
|
| 154 |
f"OUTPUT FORMAT:\n"
|
| 155 |
+
f"QUESTION: [Your Question]\n"
|
| 156 |
+
f"QUOTE: [The exact text snippet used]"
|
| 157 |
)
|
| 158 |
|
| 159 |
def construct_grading_prompt(self, question, answer, context_text):
|