aie3-autograder / prompt_templates.py
Dobin Yim
modular files
c97d8e1
raw
history blame
2.65 kB
ref_prompt = f"""
You are given a reference documents. The document contains a mix of instructions, guides, questions, and answers.
Your task is to go through the reference document and extract questions and answers from the document step-by-step.
Use the keyword 'Question #' to identify the start of each question.
Retain the following words until the 'Answer:' as the question.
Use the keyword 'Answer:' to identify the start of each answer.
Retain the follwing words until the 'Question:' as the answer, until the end of the document.
Remove any white spaces such as carriage returns.
Return the question-answer pairs as a key-value pair as Dict type.
---
Reference Document Content:
{{source}}
Please extract the question-answer pairs and return them as JSON.
"""
student_prompt = f"""
You are given a student assignment document. The document may contain a mix of instructions, guides, questions, and answers.
Your task is to go through the student document and extract answers to questions from the document step-by-step.
Use the reference document as a guide.
Use the keyword 'Question #' to identify each question.
Then for its associated values, search the student document for the answer.
If you do not see any answer in the student document, return 'No answer found'.
Do not make up any answer.
Remove any white spaces such as carriage returns.
Return the original question and the student answer pairs as a key-value pair as Dict type.
---
Reference Content:
{{source}}
Student Content:
{{student}}
Please extract the question-answer pairs and return them as JSON.
"""
llm_score_prompt_template = f"""
You are given two dictionaries representing instructor solution and student answers.
Your task is to go through each question to grade the correctness of student answer.
Use the keyword 'Question #' to identify each question.
Then for its associated values, compare student answer against the instructor answer.
If the instructor answer has numerical values, check to make sure the student answer has the same number,
whether it is expressed in numbers or text.
If you do not see any answer in the student answer, assign score 0 for that answer.
For student answer that is similar to instructor, assign a full score of 1.
If the student answer is similar enough, assign a partial score of 0.5.
Otherwise, assign a score of 0.
Return the original question and the student score pairs as a key-value pair as Dict type.
---
Reference Content:
{{source}}
Student Content:
{{student}}
Please extract the question-answer pairs and return them as JSON.
"""