Commit 3e9420ad authored by Marianne Stecklina's avatar Marianne Stecklina Committed by thomwolf
Browse files

Make file reading more robust

parent cde42c43
...@@ -75,7 +75,7 @@ def read_examples_from_file(data_dir, evaluate=False): ...@@ -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,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment