Spaces:
Runtime error
Runtime error
Update game1.py
Browse files
game1.py
CHANGED
@@ -284,7 +284,7 @@ def interpre1(lang_selected, num_selected):
|
|
284 |
text = eval(content[int(num_selected*2)])
|
285 |
interpretation = eval(content[int(num_selected*2+1)])
|
286 |
|
287 |
-
encodings = tokenizer(text['text'], return_offsets_mapping=True)
|
288 |
print(encodings)
|
289 |
print(encodings['offset_mapping'])
|
290 |
is_subword = np.array(encodings['offset_mapping'])[:,0] != 0
|
|
|
284 |
text = eval(content[int(num_selected*2)])
|
285 |
interpretation = eval(content[int(num_selected*2+1)])
|
286 |
|
287 |
+
encodings = tokenizer(text['text'].split(' '), is_pretokenized=True, return_offsets_mapping=True)
|
288 |
print(encodings)
|
289 |
print(encodings['offset_mapping'])
|
290 |
is_subword = np.array(encodings['offset_mapping'])[:,0] != 0
|