improved XML prompt
Browse files- config/format_mappings.py +23 -21
- config/templates.py +5 -5
config/format_mappings.py
CHANGED
|
@@ -4,37 +4,37 @@
|
|
| 4 |
FORMAT_MAPPINGS_EXERCISES = {
|
| 5 |
"Markdown": (
|
| 6 |
"Please reformat in Markdown, following this example:\n"
|
| 7 |
-
"**Theorie
|
| 8 |
"Eenzaamheid wordt door ieder persoon anders ervaren en is daarom subjectief.\n\n"
|
| 9 |
"---\n\n"
|
| 10 |
-
"**Vraag
|
| 11 |
"Wat is de meest passende definitie van eenzaamheid?\n\n"
|
| 12 |
-
"1. Het gevoel geen connectie te hebben met anderen
|
| 13 |
-
"2. Regelmatig in je eentje zijn
|
| 14 |
-
"3. Beide bovenstaande
|
| 15 |
-
"4. Geen van bovenstaande
|
| 16 |
-
"**Correct antwoord
|
| 17 |
-
"1. Het gevoel geen connectie te hebben met anderen"
|
|
|
|
|
|
|
| 18 |
),
|
| 19 |
"XML": (
|
| 20 |
"Please reformat in XML, following this example:\n"
|
| 21 |
"<exercise>\n"
|
| 22 |
" <content>\n"
|
| 23 |
-
" <
|
| 24 |
"Eenzaamheid wordt door ieder persoon anders ervaren en is daarom subjectief.\n\n"
|
| 25 |
"Vraag:\n"
|
| 26 |
-
"Wat is de meest passende definitie van eenzaamheid?</
|
| 27 |
-
" <
|
| 28 |
-
" <
|
| 29 |
-
" <
|
| 30 |
-
" <
|
| 31 |
-
" <
|
| 32 |
-
" </
|
| 33 |
" </content>\n"
|
| 34 |
-
"
|
| 35 |
-
" <
|
| 36 |
-
" <explanation></explanation>\n"
|
| 37 |
-
" </answer>\n"
|
| 38 |
"</exercise>"
|
| 39 |
),
|
| 40 |
"Plaintext": (
|
|
@@ -48,7 +48,9 @@ FORMAT_MAPPINGS_EXERCISES = {
|
|
| 48 |
"3. Beide bovenstaande\n"
|
| 49 |
"4. Geen van bovenstaande\n\n"
|
| 50 |
"Correct antwoord:\n"
|
| 51 |
-
"1. Het gevoel geen connectie te hebben met anderen"
|
|
|
|
|
|
|
| 52 |
)
|
| 53 |
}
|
| 54 |
|
|
|
|
| 4 |
FORMAT_MAPPINGS_EXERCISES = {
|
| 5 |
"Markdown": (
|
| 6 |
"Please reformat in Markdown, following this example:\n"
|
| 7 |
+
"**Theorie:**\n"
|
| 8 |
"Eenzaamheid wordt door ieder persoon anders ervaren en is daarom subjectief.\n\n"
|
| 9 |
"---\n\n"
|
| 10 |
+
"**Vraag:**\n"
|
| 11 |
"Wat is de meest passende definitie van eenzaamheid?\n\n"
|
| 12 |
+
"1. Het gevoel geen connectie te hebben met anderen\n"
|
| 13 |
+
"2. Regelmatig in je eentje zijn\n"
|
| 14 |
+
"3. Beide bovenstaande\n"
|
| 15 |
+
"4. Geen van bovenstaande\n\n"
|
| 16 |
+
"**Correct antwoord:**\n"
|
| 17 |
+
"1. Het gevoel geen connectie te hebben met anderen\n\n"
|
| 18 |
+
"**Uitleg:**\n"
|
| 19 |
+
"Connectie betekent verbinding."
|
| 20 |
),
|
| 21 |
"XML": (
|
| 22 |
"Please reformat in XML, following this example:\n"
|
| 23 |
"<exercise>\n"
|
| 24 |
" <content>\n"
|
| 25 |
+
" <prompt>Theorie:\n"
|
| 26 |
"Eenzaamheid wordt door ieder persoon anders ervaren en is daarom subjectief.\n\n"
|
| 27 |
"Vraag:\n"
|
| 28 |
+
"Wat is de meest passende definitie van eenzaamheid?</prompt>\n"
|
| 29 |
+
" <options>\n"
|
| 30 |
+
" <option id=\"1\">Het gevoel geen connectie te hebben met anderen</option>\n"
|
| 31 |
+
" <option id=\"2\">Regelmatig in je eentje zijn</option>\n"
|
| 32 |
+
" <option id=\"3\">Beide bovenstaande</option>\n"
|
| 33 |
+
" <option id=\"4\">Geen van bovenstaande</option>\n"
|
| 34 |
+
" </options>\n"
|
| 35 |
" </content>\n"
|
| 36 |
+
" <correct_answer>1</correct_answer>\n"
|
| 37 |
+
" <explanation>Connectie betekent verbinding.</explanation>\n"
|
|
|
|
|
|
|
| 38 |
"</exercise>"
|
| 39 |
),
|
| 40 |
"Plaintext": (
|
|
|
|
| 48 |
"3. Beide bovenstaande\n"
|
| 49 |
"4. Geen van bovenstaande\n\n"
|
| 50 |
"Correct antwoord:\n"
|
| 51 |
+
"1. Het gevoel geen connectie te hebben met anderen\n\n"
|
| 52 |
+
"Extra info:\n"
|
| 53 |
+
"Connectie betekent verbinding."
|
| 54 |
)
|
| 55 |
}
|
| 56 |
|
config/templates.py
CHANGED
|
@@ -20,15 +20,15 @@ from config.system_prompt_texts import (
|
|
| 20 |
|
| 21 |
template_standardize_exercise = ChatPromptTemplate(
|
| 22 |
messages=[
|
| 23 |
-
("system", "You reformat a given multiple choice exercise into a standardized format. {formatting_instructions}\n\n"
|
| 24 |
"Only 3 elements are always mandatory:\n"
|
| 25 |
"1. A question or statement that starts with 'Vraag:' or 'Stelling:' (or their semantic equivalents in the language of the exercise).\n"
|
| 26 |
-
"2. A minimum of two answer options (in the spirit of 'multiple choice'), one of them the correct answer
|
| 27 |
"3. An indication of what the correct answer is.\n\n"
|
| 28 |
"Always return an exercise with at least these mandatory elements. If any of the 3 elements are missing "
|
| 29 |
-
"in the
|
| 30 |
-
"new content that
|
| 31 |
-
"
|
| 32 |
("human", "Here's the given exercise:\n{user_input}")
|
| 33 |
],
|
| 34 |
input_variables=["user_input", "formatting_instructions"]
|
|
|
|
| 20 |
|
| 21 |
template_standardize_exercise = ChatPromptTemplate(
|
| 22 |
messages=[
|
| 23 |
+
("system", "You reformat a given multiple choice exercise into a standardized format for future human processing. {formatting_instructions}\n\n"
|
| 24 |
"Only 3 elements are always mandatory:\n"
|
| 25 |
"1. A question or statement that starts with 'Vraag:' or 'Stelling:' (or their semantic equivalents in the language of the exercise).\n"
|
| 26 |
+
"2. A minimum of two answer options (in the spirit of 'multiple choice'), one of them the correct answer.\n"
|
| 27 |
"3. An indication of what the correct answer is.\n\n"
|
| 28 |
"Always return an exercise with at least these mandatory elements. If any of the 3 elements are missing "
|
| 29 |
+
"in the given exercise, do your educated best to make them up. Except for the 3 mandatory elements, never make up any "
|
| 30 |
+
"new content that was not present in the given exercise. For example, if the exercise doesn't include an explanation, completely leave this out in your version as well. You should sometimes leave out certain content "
|
| 31 |
+
"that is there, like any artifacts in the given exercise that don't contribute to its understandability."),
|
| 32 |
("human", "Here's the given exercise:\n{user_input}")
|
| 33 |
],
|
| 34 |
input_variables=["user_input", "formatting_instructions"]
|