Update speaking 3 to have 5 questions.
This commit is contained in:
27
app.py
27
app.py
@@ -843,21 +843,32 @@ def get_speaking_task_2_question():
|
|||||||
def get_speaking_task_3_question():
|
def get_speaking_task_3_question():
|
||||||
difficulty = request.args.get("difficulty", default=random.choice(difficulties))
|
difficulty = request.args.get("difficulty", default=random.choice(difficulties))
|
||||||
topic = request.args.get("topic", default=random.choice(mti_topics))
|
topic = request.args.get("topic", default=random.choice(mti_topics))
|
||||||
|
|
||||||
|
json_format = {
|
||||||
|
"topic": "topic",
|
||||||
|
"questions": [
|
||||||
|
"Introductory question, should start with a greeting and introduce a question about the topic.",
|
||||||
|
"Follow up question about the topic",
|
||||||
|
"Follow up question about the topic",
|
||||||
|
"Follow up question about the topic",
|
||||||
|
"Follow up question about the topic"
|
||||||
|
]
|
||||||
|
}
|
||||||
try:
|
try:
|
||||||
messages = [
|
messages = [
|
||||||
{
|
{
|
||||||
"role": "system",
|
"role": "system",
|
||||||
"content": (
|
"content": (
|
||||||
'You are a helpful assistant designed to output JSON on this format: '
|
'You are a helpful assistant designed to output JSON on this format: ' + str(json_format))
|
||||||
'{"topic": "topic", "questions": ["question", "question", "question"]}')
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"role": "user",
|
"role": "user",
|
||||||
"content": (
|
"content": (
|
||||||
'Formulate a set of 3 questions of ' + difficulty + ' difficulty for IELTS Speaking Part 3 that encourage candidates to engage in a '
|
'Formulate a set of 5 questions of hard difficulty for IELTS Speaking Part 3 that encourage candidates to engage in a '
|
||||||
'meaningful discussion on the topic of "' + topic + '". Provide inquiries, ensuring '
|
'meaningful discussion on the topic of "' + random.choice(
|
||||||
'they explore various aspects, perspectives, and implications related to the topic.'
|
mti_topics) + '". Provide inquiries, ensuring '
|
||||||
'Make sure that the generated question does not contain forbidden subjects in muslim countries.')
|
'they explore various aspects, perspectives, and implications related to the topic.'
|
||||||
|
'Make sure that the generated question does not contain forbidden subjects in muslim countries.')
|
||||||
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
@@ -1000,7 +1011,7 @@ def grade_speaking_task_3():
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"role": "user",
|
"role": "user",
|
||||||
"content": 'Address the student as "you".'
|
"content": 'Address the student as "you" and pay special attention to coherence between the answers.'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"role": "user",
|
"role": "user",
|
||||||
@@ -1015,7 +1026,7 @@ def grade_speaking_task_3():
|
|||||||
token_count = count_total_tokens(messages)
|
token_count = count_total_tokens(messages)
|
||||||
|
|
||||||
logging.info("POST - speaking_task_3 - " + str(request_id) + " - Requesting grading of the answers.")
|
logging.info("POST - speaking_task_3 - " + str(request_id) + " - Requesting grading of the answers.")
|
||||||
response = make_openai_call(GPT_3_5_TURBO, messages, token_count, ["comment"], GRADING_TEMPERATURE)
|
response = make_openai_call(GPT_4_O, messages, token_count, ["comment"], GRADING_TEMPERATURE)
|
||||||
logging.info("POST - speaking_task_3 - " + str(request_id) + " - Answers graded: " + str(response))
|
logging.info("POST - speaking_task_3 - " + str(request_id) + " - Answers graded: " + str(response))
|
||||||
|
|
||||||
logging.info("POST - speaking_task_3 - " + str(request_id) + " - Adding perfect answers to response.")
|
logging.info("POST - speaking_task_3 - " + str(request_id) + " - Adding perfect answers to response.")
|
||||||
|
|||||||
Reference in New Issue
Block a user