Spaces:
Sleeping
Sleeping
Update game3.py
Browse files
game3.py
CHANGED
|
@@ -5,11 +5,8 @@ import pandas as pd
|
|
| 5 |
import gradio as gr
|
| 6 |
import numpy as np
|
| 7 |
|
| 8 |
-
def read3(
|
| 9 |
-
|
| 10 |
-
fname = 'data1_en.txt'
|
| 11 |
-
else:
|
| 12 |
-
fname = 'data1_nl_10.txt'
|
| 13 |
with open(fname, encoding='utf-8') as f:
|
| 14 |
content = f.readlines()
|
| 15 |
index_selected = random.randint(0,len(content)/2-1)
|
|
@@ -17,10 +14,9 @@ def read3(lang, num_selected_former):
|
|
| 17 |
index_selected = random.randint(0,len(content)/2-1)
|
| 18 |
text = eval(content[index_selected*2])
|
| 19 |
interpretation = eval(content[int(index_selected*2+1)])
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
min_len = 2
|
| 24 |
tokens = [i[0] for i in interpretation]
|
| 25 |
tokens = tokens[1:-1]
|
| 26 |
while len(tokens) <= min_len or '\\' in text['text'] or '//' in text['text']:
|
|
|
|
| 5 |
import gradio as gr
|
| 6 |
import numpy as np
|
| 7 |
|
| 8 |
+
def read3(num_selected_former):
|
| 9 |
+
fname = 'data3_convai2_inferred.txt'
|
|
|
|
|
|
|
|
|
|
| 10 |
with open(fname, encoding='utf-8') as f:
|
| 11 |
content = f.readlines()
|
| 12 |
index_selected = random.randint(0,len(content)/2-1)
|
|
|
|
| 14 |
index_selected = random.randint(0,len(content)/2-1)
|
| 15 |
text = eval(content[index_selected*2])
|
| 16 |
interpretation = eval(content[int(index_selected*2+1)])
|
| 17 |
+
|
| 18 |
+
min_len = 5
|
| 19 |
+
|
|
|
|
| 20 |
tokens = [i[0] for i in interpretation]
|
| 21 |
tokens = tokens[1:-1]
|
| 22 |
while len(tokens) <= min_len or '\\' in text['text'] or '//' in text['text']:
|