Skip to content

Commit dbf9b64

Browse files
committed
Change condition and reorder lines.
1 parent 3566228 commit dbf9b64

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

app/evaluation.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,11 @@ def evaluation_function(response, answer, params):
112112
dif = ans_score[0] - resp_score[0]
113113
word = resp_score[1]
114114

115+
both_one_word = len(response.split(' ')) == 1 and len(answer.split(' ')) == 1
115116
more_info_msg = f'Please provide more information about {word}' if word is not None else ''
116117
feedback_msg = (
117-
f"Cannot determine if the answer is correct ({'%.3f'%(w2v_similarity)}% similarity). {more_info_msg}" if len(response.split(' ')) > 1
118-
else "Incorrect" )
118+
"Incorrect" if both_one_word
119+
else f"Cannot determine if the answer is correct ({'%.3f'%(w2v_similarity)}% similarity). {more_info_msg}" )
119120

120121
return {
121122
"is_correct": False,

0 commit comments

Comments
 (0)