Spaces:
Sleeping
Sleeping
Update game3.py
Browse files
game3.py
CHANGED
|
@@ -25,22 +25,10 @@ def read3(num_selected_former):
|
|
| 25 |
index_selected = random.randint(0,len(content)/2-1)
|
| 26 |
text = eval(content[int(index_selected*2)])
|
| 27 |
res_tmp = [(i, 0) for i in text['text'].split(' ')]
|
| 28 |
-
res = {"original": text['text'], "interpretation": res_tmp}
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
# res = []
|
| 32 |
-
# res.append(("P", "+"))
|
| 33 |
-
# res.append(("/", None))
|
| 34 |
-
# res.append(("N", "-"))
|
| 35 |
-
# res.append(("Review:", None))
|
| 36 |
-
# for i in text['text'].split(' '):
|
| 37 |
-
# res.append((i, None))
|
| 38 |
-
# res_empty = None
|
| 39 |
-
# checkbox_update = gr.CheckboxGroup.update(choices=tokens, value=None)
|
| 40 |
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
def func3(lang_selected, num_selected, human_predict, num1, num2, user_important):
|
| 44 |
chatbot = []
|
| 45 |
# num1: Human score; num2: AI score
|
| 46 |
fname = 'data3_convai2_inferred.txt'
|
|
@@ -49,10 +37,9 @@ def func3(lang_selected, num_selected, human_predict, num1, num2, user_important
|
|
| 49 |
content = f.readlines()
|
| 50 |
text = eval(content[int(num_selected*2)])
|
| 51 |
interpretation = eval(content[int(num_selected*2+1)])
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
golden_label = text['label'] * 100
|
| 56 |
|
| 57 |
'''
|
| 58 |
# (START) API version -- quick
|
|
|
|
| 25 |
index_selected = random.randint(0,len(content)/2-1)
|
| 26 |
text = eval(content[int(index_selected*2)])
|
| 27 |
res_tmp = [(i, 0) for i in text['text'].split(' ')]
|
| 28 |
+
res = {"original": text['text'], "interpretation": res_tmp}
|
| 29 |
+
return res, index_selected
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 30 |
|
| 31 |
+
def func3(num_selected, human_predict, num1, num2, user_important):
|
|
|
|
|
|
|
| 32 |
chatbot = []
|
| 33 |
# num1: Human score; num2: AI score
|
| 34 |
fname = 'data3_convai2_inferred.txt'
|
|
|
|
| 37 |
content = f.readlines()
|
| 38 |
text = eval(content[int(num_selected*2)])
|
| 39 |
interpretation = eval(content[int(num_selected*2+1)])
|
| 40 |
+
|
| 41 |
+
golden_label = (text['label']^1) * 100
|
| 42 |
+
|
|
|
|
| 43 |
|
| 44 |
'''
|
| 45 |
# (START) API version -- quick
|