未验证 提交 f97e3c85 编写于 作者: T tianxin 提交者: GitHub

Merge pull request #150 from xiegegege/develop

fix for py3
...@@ -75,7 +75,7 @@ class ErnieDataReader(object): ...@@ -75,7 +75,7 @@ class ErnieDataReader(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) == 5, "One sample must have 5 fields!" assert len(line) == 5, "One sample must have 5 fields!"
(token_ids, sent_ids, pos_ids, seg_labels, label) = line (token_ids, sent_ids, pos_ids, seg_labels, 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.
先完成此消息的编辑!
想要评论请 注册