Spaces:
Sleeping
Sleeping
Update game3.py
Browse files
game3.py
CHANGED
|
@@ -4,6 +4,8 @@ import time
|
|
| 4 |
import pandas as pd
|
| 5 |
import gradio as gr
|
| 6 |
import numpy as np
|
|
|
|
|
|
|
| 7 |
|
| 8 |
def read3(num_selected_former):
|
| 9 |
fname = 'data3_convai2_inferred.txt'
|
|
@@ -41,10 +43,8 @@ def read3(num_selected_former):
|
|
| 41 |
def func3(lang_selected, num_selected, human_predict, num1, num2, user_important):
|
| 42 |
chatbot = []
|
| 43 |
# num1: Human score; num2: AI score
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
else:
|
| 47 |
-
fname = 'data1_nl_10.txt'
|
| 48 |
with open(fname) as f:
|
| 49 |
content = f.readlines()
|
| 50 |
text = eval(content[int(num_selected*2)])
|
|
@@ -223,10 +223,7 @@ def func3(lang_selected, num_selected, human_predict, num1, num2, user_important
|
|
| 223 |
return ai_predict, chatbot, num1, num2, tot_scores
|
| 224 |
|
| 225 |
def interpre3(lang_selected, num_selected):
|
| 226 |
-
|
| 227 |
-
fname = 'data1_en.txt'
|
| 228 |
-
else:
|
| 229 |
-
fname = 'data1_nl_10.txt'
|
| 230 |
with open(fname) as f:
|
| 231 |
content = f.readlines()
|
| 232 |
text = eval(content[int(num_selected*2)])
|
|
@@ -291,9 +288,6 @@ def func3_written(text_written, human_predict, lang_written):
|
|
| 291 |
'''
|
| 292 |
|
| 293 |
# (START) off-the-shelf version
|
| 294 |
-
from transformers import AutoTokenizer, AutoModelForSequenceClassification
|
| 295 |
-
from transformers import pipeline
|
| 296 |
-
|
| 297 |
|
| 298 |
# tokenizer = AutoTokenizer.from_pretrained("nlptown/bert-base-multilingual-uncased-sentiment")
|
| 299 |
# model = AutoModelForSequenceClassification.from_pretrained("nlptown/bert-base-multilingual-uncased-sentiment")
|
|
|
|
| 4 |
import pandas as pd
|
| 5 |
import gradio as gr
|
| 6 |
import numpy as np
|
| 7 |
+
from transformers import AutoTokenizer, AutoModelForSequenceClassification
|
| 8 |
+
from transformers import pipeline
|
| 9 |
|
| 10 |
def read3(num_selected_former):
|
| 11 |
fname = 'data3_convai2_inferred.txt'
|
|
|
|
| 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'
|
| 47 |
+
|
|
|
|
|
|
|
| 48 |
with open(fname) as f:
|
| 49 |
content = f.readlines()
|
| 50 |
text = eval(content[int(num_selected*2)])
|
|
|
|
| 223 |
return ai_predict, chatbot, num1, num2, tot_scores
|
| 224 |
|
| 225 |
def interpre3(lang_selected, num_selected):
|
| 226 |
+
fname = 'data3_convai2_inferred.txt'
|
|
|
|
|
|
|
|
|
|
| 227 |
with open(fname) as f:
|
| 228 |
content = f.readlines()
|
| 229 |
text = eval(content[int(num_selected*2)])
|
|
|
|
| 288 |
'''
|
| 289 |
|
| 290 |
# (START) off-the-shelf version
|
|
|
|
|
|
|
|
|
|
| 291 |
|
| 292 |
# tokenizer = AutoTokenizer.from_pretrained("nlptown/bert-base-multilingual-uncased-sentiment")
|
| 293 |
# model = AutoModelForSequenceClassification.from_pretrained("nlptown/bert-base-multilingual-uncased-sentiment")
|