未验证 提交 b77d0354 编写于 作者: Y Yibing Liu 提交者: GitHub

Merge pull request #100 from xiegegege/develop

fix for py3
...@@ -78,7 +78,7 @@ class DataReader(object): ...@@ -78,7 +78,7 @@ class DataReader(object):
def parse_line(self, line, max_seq_len=512): def parse_line(self, line, max_seq_len=512):
""" parse one line to token_ids, sentence_ids, pos_ids, label """ parse one line to token_ids, sentence_ids, pos_ids, label
""" """
line = line.strip().split(";") line = line.strip().decode().split(";")
assert len(line) == 4, "One sample must have 4 fields!" assert len(line) == 4, "One sample must have 4 fields!"
(token_ids, sent_ids, pos_ids, label) = line (token_ids, sent_ids, pos_ids, label) = line
token_ids = [int(token) for token in token_ids.split(" ")] token_ids = [int(token) for token in token_ids.split(" ")]
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册