Double check for english words in writing grading.
This commit is contained in:
12
app.py
12
app.py
@@ -218,7 +218,7 @@ def grade_writing_task_1():
|
|||||||
answer = data.get('answer')
|
answer = data.get('answer')
|
||||||
if not has_words(answer):
|
if not has_words(answer):
|
||||||
return {
|
return {
|
||||||
'comment': "The answer does not contain any english words.",
|
'comment': "The answer does not contain enough english words.",
|
||||||
'overall': 0,
|
'overall': 0,
|
||||||
'task_response': {
|
'task_response': {
|
||||||
'Coherence and Cohesion': 0,
|
'Coherence and Cohesion': 0,
|
||||||
@@ -256,6 +256,10 @@ def grade_writing_task_1():
|
|||||||
'Additionally, provide an exemplary answer with a minimum of 150 words, along with a '
|
'Additionally, provide an exemplary answer with a minimum of 150 words, along with a '
|
||||||
'detailed commentary highlighting both strengths and weaknesses in the response. '
|
'detailed commentary highlighting both strengths and weaknesses in the response. '
|
||||||
'\n Question: "' + question + '" \n Answer: "' + answer + '"')
|
'\n Question: "' + question + '" \n Answer: "' + answer + '"')
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"role": "user",
|
||||||
|
"content": 'The perfect answer must have at least 150 words.'
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
token_count = count_total_tokens(messages)
|
token_count = count_total_tokens(messages)
|
||||||
@@ -314,7 +318,7 @@ def grade_writing_task_2():
|
|||||||
answer = data.get('answer')
|
answer = data.get('answer')
|
||||||
if not has_words(answer):
|
if not has_words(answer):
|
||||||
return {
|
return {
|
||||||
'comment': "The answer does not contain any english words.",
|
'comment': "The answer does not contain enough english words.",
|
||||||
'overall': 0,
|
'overall': 0,
|
||||||
'task_response': {
|
'task_response': {
|
||||||
'Coherence and Cohesion': 0,
|
'Coherence and Cohesion': 0,
|
||||||
@@ -353,6 +357,10 @@ def grade_writing_task_2():
|
|||||||
'exemplary answer with a minimum of 250 words, along with a detailed commentary highlighting '
|
'exemplary answer with a minimum of 250 words, along with a detailed commentary highlighting '
|
||||||
'both strengths and weaknesses in the response.'
|
'both strengths and weaknesses in the response.'
|
||||||
'\n Question: "' + question + '" \n Answer: "' + answer + '"')
|
'\n Question: "' + question + '" \n Answer: "' + answer + '"')
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"role": "user",
|
||||||
|
"content": 'The perfect answer must have at least 250 words.'
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
token_count = count_total_tokens(messages)
|
token_count = count_total_tokens(messages)
|
||||||
|
|||||||
BIN
requirements.txt
BIN
requirements.txt
Binary file not shown.
Reference in New Issue
Block a user