Update teacher_function.py
#3
by
roshnn24
- opened
- teacher_function.py +6 -12
teacher_function.py
CHANGED
|
@@ -57,21 +57,16 @@ def extract_text_from_image(image_path):
|
|
| 57 |
def evaluate(question, answer, max_marks):
|
| 58 |
prompt = f"""Questions: {question}
|
| 59 |
Answer: {answer}.
|
| 60 |
-
Evaluate answers strictly one by one(if there are multiple) for each question and assign marks out of {max_marks} based on below guidelines.
|
| 61 |
-
guidelines:
|
| 62 |
-
- If the answer is wrong or incorrect or irrelevent to topic, give 0 marks.
|
| 63 |
|
| 64 |
-
- If the answer is somewhat accurate, give total marks minus 2, and so on.
|
| 65 |
-
- If the answer is very accurate and complete, give total marks.
|
| 66 |
-
- If the answer is good but not completely accurate, give total marks minus 1.
|
| 67 |
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
|
|
|
| 72 |
|
| 73 |
messages = [
|
| 74 |
-
{"role": "system", "content": "You are
|
| 75 |
{"role": "user", "content": prompt}
|
| 76 |
]
|
| 77 |
|
|
@@ -83,7 +78,6 @@ Format:
|
|
| 83 |
):
|
| 84 |
if chunk.choices[0].delta.content:
|
| 85 |
response_content += chunk.choices[0].delta.content
|
| 86 |
-
print(response_content)
|
| 87 |
|
| 88 |
return response_content
|
| 89 |
|
|
|
|
| 57 |
def evaluate(question, answer, max_marks):
|
| 58 |
prompt = f"""Questions: {question}
|
| 59 |
Answer: {answer}.
|
|
|
|
|
|
|
|
|
|
| 60 |
|
|
|
|
|
|
|
|
|
|
| 61 |
|
| 62 |
+
Evaluate above questions one by one(if there are multiple) by provided answers and assign marks out of {max_marks}. No need overall score. Note that as maximum mark increases, the size of the answer must be large enough to get good marks. Give ouput in format below:
|
| 63 |
+
description:
|
| 64 |
+
assigned marks:
|
| 65 |
+
total marks:
|
| 66 |
+
Note that you should not display total marks"""
|
| 67 |
|
| 68 |
messages = [
|
| 69 |
+
{"role": "system", "content": "You are an answer evaluator"},
|
| 70 |
{"role": "user", "content": prompt}
|
| 71 |
]
|
| 72 |
|
|
|
|
| 78 |
):
|
| 79 |
if chunk.choices[0].delta.content:
|
| 80 |
response_content += chunk.choices[0].delta.content
|
|
|
|
| 81 |
|
| 82 |
return response_content
|
| 83 |
|