Spaces:
Runtime error
Runtime error
Update game3.py
Browse files
game3.py
CHANGED
@@ -39,11 +39,11 @@ def func3(num_selected, human_predict, num1, num2, user_important):
|
|
39 |
text = eval(content[int(num_selected*2)])
|
40 |
interpretation = eval(content[int(num_selected*2+1)])
|
41 |
|
42 |
-
|
43 |
-
if golden_label == 0:
|
44 |
golden_label = int(50 * (1 - text['binary_score']))
|
45 |
else:
|
46 |
golden_label = int(50 * (1 + text['binary_score']))
|
|
|
47 |
# (START) off-the-shelf version -- slow at the beginning
|
48 |
# Load model directly
|
49 |
# Use a pipeline as a high-level helper
|
@@ -57,9 +57,9 @@ def func3(num_selected, human_predict, num1, num2, user_important):
|
|
57 |
# (END) off-the-shelf version
|
58 |
|
59 |
if out['label'] == 'Female':
|
60 |
-
ai_predict = int(out['score'])
|
61 |
else:
|
62 |
-
ai_predict = 1 - int(out['score'])
|
63 |
|
64 |
user_select = "You focused on "
|
65 |
flag_select = False
|
@@ -165,9 +165,9 @@ def func3_written(text_written, human_predict, lang_written):
|
|
165 |
# (END) off-the-shelf version
|
166 |
|
167 |
if out['label'] == 'Female':
|
168 |
-
ai_predict = int(out['score'])
|
169 |
else:
|
170 |
-
ai_predict = 1 - int(out['score'])
|
171 |
|
172 |
if abs(ai_predict - human_predict) <= 20:
|
173 |
chatbot.append(("AI gives it a close score! 🎉", "⬅️ Feel free to try another one! ⬅️"))
|
|
|
39 |
text = eval(content[int(num_selected*2)])
|
40 |
interpretation = eval(content[int(num_selected*2+1)])
|
41 |
|
42 |
+
if text['binary_label'] == 1:
|
|
|
43 |
golden_label = int(50 * (1 - text['binary_score']))
|
44 |
else:
|
45 |
golden_label = int(50 * (1 + text['binary_score']))
|
46 |
+
|
47 |
# (START) off-the-shelf version -- slow at the beginning
|
48 |
# Load model directly
|
49 |
# Use a pipeline as a high-level helper
|
|
|
57 |
# (END) off-the-shelf version
|
58 |
|
59 |
if out['label'] == 'Female':
|
60 |
+
ai_predict = int(100 * out['score'])
|
61 |
else:
|
62 |
+
ai_predict = 1 - int(100 * out['score'])
|
63 |
|
64 |
user_select = "You focused on "
|
65 |
flag_select = False
|
|
|
165 |
# (END) off-the-shelf version
|
166 |
|
167 |
if out['label'] == 'Female':
|
168 |
+
ai_predict = int(100 * out['score'])
|
169 |
else:
|
170 |
+
ai_predict = 1 - int(100 * out['score'])
|
171 |
|
172 |
if abs(ai_predict - human_predict) <= 20:
|
173 |
chatbot.append(("AI gives it a close score! 🎉", "⬅️ Feel free to try another one! ⬅️"))
|