JRQi commited on
Commit
8146efe
1 Parent(s): 455ee26

Update game1.py

Browse files
Files changed (1) hide show
  1. game1.py +4 -4
game1.py CHANGED
@@ -288,7 +288,7 @@ def interpre1(lang_selected, num_selected):
288
  index_tmp = 0
289
  while index_tmp < (len(interpretation) - 1):
290
  if not is_subword[index_tmp+1]:
291
- interpretation_combined.append(interpretation[index_tmp])
292
  index_tmp += 1
293
  else:
294
  text_combined = interpretation[index_tmp][0]
@@ -298,7 +298,7 @@ def interpre1(lang_selected, num_selected):
298
  text_combined += interpretation[index_tmp+length][0]
299
  score_combinded += interpretation[index_tmp+length][1]
300
  length += 1
301
- interpretation_combined.append((text_combined, score_combinded/length))
302
  index_tmp += length
303
 
304
  interpretation_combined.append(('', 0.0))
@@ -424,7 +424,7 @@ def func1_written(text_written, human_predict, lang_written):
424
  index_tmp = 0
425
  while index_tmp < (len(interpretation) - 1):
426
  if not is_subword[index_tmp+1]:
427
- interpretation_combined.append(interpretation[index_tmp])
428
  index_tmp += 1
429
  else:
430
  text_combined = interpretation[index_tmp][0]
@@ -434,7 +434,7 @@ def func1_written(text_written, human_predict, lang_written):
434
  text_combined += interpretation[index_tmp+length][0]
435
  score_combinded += interpretation[index_tmp+length][1]
436
  length += 1
437
- interpretation_combined.append((text_combined, score_combinded/length))
438
  index_tmp += length
439
 
440
  interpretation_combined.append(('', 0.0))
 
288
  index_tmp = 0
289
  while index_tmp < (len(interpretation) - 1):
290
  if not is_subword[index_tmp+1]:
291
+ interpretation_combined.append((interpretation[index_tmp][0], -interpretation[index_tmp][1])
292
  index_tmp += 1
293
  else:
294
  text_combined = interpretation[index_tmp][0]
 
298
  text_combined += interpretation[index_tmp+length][0]
299
  score_combinded += interpretation[index_tmp+length][1]
300
  length += 1
301
+ interpretation_combined.append((text_combined, -score_combinded/length))
302
  index_tmp += length
303
 
304
  interpretation_combined.append(('', 0.0))
 
424
  index_tmp = 0
425
  while index_tmp < (len(interpretation) - 1):
426
  if not is_subword[index_tmp+1]:
427
+ interpretation_combined.append((interpretation[index_tmp][0], -interpretation[index_tmp][1])
428
  index_tmp += 1
429
  else:
430
  text_combined = interpretation[index_tmp][0]
 
434
  text_combined += interpretation[index_tmp+length][0]
435
  score_combinded += interpretation[index_tmp+length][1]
436
  length += 1
437
+ interpretation_combined.append((text_combined, -score_combinded/length))
438
  index_tmp += length
439
 
440
  interpretation_combined.append(('', 0.0))