Make file reading more robust

This commit is contained in:
Marianne Stecklina authored and thomwolf committed 2019-10-15 09:17:31 +02:00
1 parent 383ef96747
commit e1d4179b64
1 file changed
+1 -1
+1 -1
View File
@@ -75,7 +75,7 @@ def read_examples_from_file(data_dir, evaluate=False):
else: else:
splits = line.split(" ") splits = line.split(" ")
words.append(splits[0]) words.append(splits[0])
labels.append(splits[-1][:-1]) labels.append(splits[-1].replace("\n", ""))
if words: if words:
examples.append(InputExample(guid="%s-%d".format(guid_prefix, guid_index), examples.append(InputExample(guid="%s-%d".format(guid_prefix, guid_index),
words=words, words=words,