BtB-ExpC commited on
Commit
7d22bea
·
1 Parent(s): 2f6ef61

refined standardization template

Browse files
Files changed (2) hide show
  1. config/format_mappings.py +2 -2
  2. config/templates.py +7 -3
config/format_mappings.py CHANGED
@@ -2,7 +2,7 @@
2
 
3
  FORMAT_MAPPINGS = {
4
  "Markdown": (
5
- "Please format the exercise in Markdown, similarly to this example:\n\n"
6
  "**Theorie:** \n"
7
  "Eenzaamheid wordt door ieder persoon anders ervaren en is daarom subjectief.\n\n"
8
  "---\n\n"
@@ -37,7 +37,7 @@ FORMAT_MAPPINGS = {
37
  "</exercise>"
38
  ),
39
  "Plaintext": (
40
- "Please reformat in plain text, following this example:\n\n"
41
  "Theorie:\n"
42
  "Eenzaamheid wordt door ieder persoon anders ervaren en is daarom subjectief.\n\n"
43
  "Vraag:\n"
 
2
 
3
  FORMAT_MAPPINGS = {
4
  "Markdown": (
5
+ "Please reformat in Markdown, following this example:\n"
6
  "**Theorie:** \n"
7
  "Eenzaamheid wordt door ieder persoon anders ervaren en is daarom subjectief.\n\n"
8
  "---\n\n"
 
37
  "</exercise>"
38
  ),
39
  "Plaintext": (
40
+ "Please reformat in plain text, following this example:\n"
41
  "Theorie:\n"
42
  "Eenzaamheid wordt door ieder persoon anders ervaren en is daarom subjectief.\n\n"
43
  "Vraag:\n"
config/templates.py CHANGED
@@ -4,9 +4,13 @@ from langchain_core.prompts.chat import ChatPromptTemplate
4
  # Template to standardize the exercise description.
5
  standardize_template = ChatPromptTemplate(
6
  messages=[
7
- ("system", "You reformat data on multiple choice exercises. Convert the given exercise(s) into a standardized format. {formatting_instructions}\n"
8
- "Only return an exercise with the minimum required content, no need to make up any unrequired new content if it is not present in the given exercise (like the 'Theorie' part)"),
9
- ("human", "{user_input}")
 
 
 
 
10
  ],
11
  input_variables=["user_input", "formatting_instructions"]
12
  )
 
4
  # Template to standardize the exercise description.
5
  standardize_template = ChatPromptTemplate(
6
  messages=[
7
+ ("system", "You reformat a given multiple choice exercise into a standardized format. {formatting_instructions}\n\n"
8
+ "Only 3 elements are always mandatory:\n "
9
+ "1. A question or statement\n"
10
+ "2. A minimum of two answer options (in the spirit of 'multiple choice'), one of them the correct answer\n"
11
+ "3. An indication of what the correct answer is.\n\n"
12
+ "Always return an exercise with these minimum required elements. If any of the 3 elements are missing in the input, do your best to generate them. Beyond the 3 mandatory elements, never make up any new content that is not present in the given exercise."),
13
+ ("human", "Here's the given exercise:\n{user_input}")
14
  ],
15
  input_variables=["user_input", "formatting_instructions"]
16
  )