Improve speaking grading.

This commit is contained in:
Cristiano Ferreira
2023-09-15 00:01:52 +01:00
parent 8f9b65281e
commit f77fafa864
3 changed files with 67 additions and 44 deletions

View File

@@ -101,75 +101,92 @@ def get_grading_messages(question_type: QuestionType, question: str, answer: str
return [
{
"role": "user",
"content": "You are a IELTS examiner.",
"content": "You are an IELTS examiner."
},
{
"role": "user",
"content": f"The question you have to grade is of type Speaking Task Part 1 and is the following: {question}",
"content": f"The question you need to grade is a Speaking Task Part 1 question, and it is as follows: {question}"
},
{
"role": "user",
"content": "It is mandatory for you to provide your response with the overall grade and breakdown grades, "
"with just the following json format: {'comment': 'comment about answer quality', 'overall': 7.0, "
"'task_response': {'Fluency and Coherence': 8.0, 'Lexical Resource': 6.5, "
"'Grammatical Range and Accuracy': 7.5, 'Pronunciation': 6.0}}",
"content": "Please provide your assessment using the following JSON format: {'comment': 'Comment about "
"answer quality', 'overall': 7.0, 'task_response': {'Fluency and Coherence': 8.0, 'Lexical "
"Resource': 6.5, 'Grammatical Range and Accuracy': 7.5, 'Pronunciation': 6.0}}"
},
{
"role": "user",
"content": "Example output: { 'comment': 'The candidate has provided a clear response to the question and has "
"given examples of how they spend their weekends. However, there are some issues with grammar and "
"pronunciation that affect the overall score. In terms of fluency and coherence, the candidate speaks "
"clearly and smoothly with only minor hesitations. They have also provided a well-organized response "
"that is easy to follow. Regarding lexical resource, the candidate has used a range of vocabulary "
"related to weekend activities but there are some errors in word choice that affect the meaning of "
"their sentences. In terms of grammatical range and accuracy, the candidate has used a mix of simple "
"and complex sentence structures but there are some errors in subject-verb agreement and preposition "
"use. Finally, regarding pronunciation, the candidate's speech is generally clear but there are some "
"issues with stress and intonation that make it difficult to understand at times.', 'overall': 6.5, "
"'task_response': {'Fluency and Coherence': 7.0, 'Lexical Resource': 6.5, 'Grammatical Range and Accuracy': 7.0,"
" 'Pronunciation': 6.0}}",
"content": "Example output: {'comment': 'The candidate has provided a clear response to the question and "
"has given examples of how they spend their weekends. However, there are some issues with grammar "
"and pronunciation that affect the overall score. In terms of fluency and coherence, the candidate "
"speaks clearly and smoothly with only minor hesitations. They have also provided a well-organized "
"response that is easy to follow. Regarding lexical resource, the candidate has used a range of "
"vocabulary related to weekend activities but there are some errors in word choice that affect "
"the meaning of their sentences. In terms of grammatical range and accuracy, the candidate has "
"used a mix of simple and complex sentence structures but there are some errors in subject-verb "
"agreement and preposition use. Finally, regarding pronunciation, the candidate's speech is "
"generally clear but there are some issues with stress and intonation that make it difficult "
"to understand at times.', 'overall': 6.5, 'task_response': {'Fluency and Coherence': 7.0, "
"'Lexical Resource': 6.5, 'Grammatical Range and Accuracy': 7.0, 'Pronunciation': 6.0}}"
},
{
"role": "user",
"content": f"Evaluate this answer according to ielts grading system: {answer}",
"content": "Please assign a grade of 0 if the answer provided does not address the question."
},
{
"role": "user",
"content": f"Assess this answer according to the IELTS grading system: {answer}"
},
{
"role": "user",
"content": "Remember to consider Fluency and Coherence, Lexical Resource, Grammatical Range and Accuracy, "
"and Pronunciation when grading the response."
}
]
elif QuestionType.SPEAKING_2 == question_type:
return [
{
"role": "user",
"content": "You are a IELTS examiner.",
"content": "You are an IELTS examiner."
},
{
"role": "user",
"content": f"The question you have to grade is of type Speaking Task Part 2 and is the following: {question}",
"content": f"The question you need to grade is a Speaking Task Part 2 question, and it is as follows: {question}"
},
{
"role": "user",
"content": "It is mandatory for you to provide your response with the overall grade and breakdown grades, "
"with just the following json format: {'comment': 'comment about answer quality', 'overall': 7.0, "
"'task_response': {'Fluency and Coherence': 8.0, 'Lexical Resource': 6.5, "
"'Grammatical Range and Accuracy': 7.5, 'Pronunciation': 6.0}}",
"content": "Please provide your assessment using the following JSON format: {\"comment\": \"Comment about "
"answer quality\", \"overall\": 7.0, \"task_response\": {\"Fluency and Coherence\": 8.0, \"Lexical "
"Resource\": 6.5, \"Grammatical Range and Accuracy\": 7.5, \"Pronunciation\": 6.0}}"
},
{
"role": "user",
"content": "Example output: { 'comment': 'The candidate has provided a clear response to the question and has "
"given examples of how they spend their weekends. However, there are some issues with grammar and "
"pronunciation that affect the overall score. In terms of fluency and coherence, the candidate speaks "
"clearly and smoothly with only minor hesitations. They have also provided a well-organized response "
"that is easy to follow. Regarding lexical resource, the candidate has used a range of vocabulary "
"related to weekend activities but there are some errors in word choice that affect the meaning of "
"their sentences. In terms of grammatical range and accuracy, the candidate has used a mix of simple "
"and complex sentence structures but there are some errors in subject-verb agreement and preposition "
"use. Finally, regarding pronunciation, the candidate's speech is generally clear but there are some "
"issues with stress and intonation that make it difficult to understand at times.', 'overall': 6.5, "
"'task_response': {'Fluency and Coherence': 7.0, 'Lexical Resource': 6.5, 'Grammatical Range and Accuracy': 7.0,"
" 'Pronunciation': 6.0}}",
"content": "Example output: {\"comment\": \"The candidate has provided a clear response to the question "
"and has given examples of how they spend their weekends. However, there are some issues with "
"grammar and pronunciation that affect the overall score. In terms of fluency and coherence, "
"the candidate speaks clearly and smoothly with only minor hesitations. They have also provided "
"a well-organized response that is easy to follow. Regarding lexical resource, the candidate "
"has used a range of vocabulary related to weekend activities but there are some errors in "
"word choice that affect the meaning of their sentences. In terms of grammatical range and "
"accuracy, the candidate has used a mix of simple and complex sentence structures but there "
"are some errors in subject-verb agreement and preposition use. Finally, regarding pronunciation, "
"the candidate's speech is generally clear but there are some issues with stress and intonation "
"that make it difficult to understand at times.\", \"overall\": 6.5, \"task_response\": {\"Fluency "
"and Coherence\": 7.0, \"Lexical Resource\": 6.5, \"Grammatical Range and Accuracy\": 7.0, "
"\"Pronunciation\": 6.0}}"
},
{
"role": "user",
"content": f"Evaluate this answer according to ielts grading system: {answer}",
"content": "Please assign a grade of 0 if the answer provided does not address the question."
},
{
"role": "user",
"content": f"Assess this answer according to the IELTS grading system: {answer}"
},
{
"role": "user",
"content": "Remember to consider Fluency and Coherence, Lexical Resource, Grammatical Range and Accuracy, "
"and Pronunciation when grading the response."
}
]
else:
raise Exception("Question type not implemented: " + question_type.value)