From 21b7ee5fb84abbf35ee1d5945303ab7cfa14bfdb Mon Sep 17 00:00:00 2001 From: xiegegege Date: Tue, 16 Apr 2019 06:48:16 +0000 Subject: [PATCH] fix for py3 --- BERT/reader/pretraining.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BERT/reader/pretraining.py b/BERT/reader/pretraining.py index 6f99d6e..c21a43d 100644 --- a/BERT/reader/pretraining.py +++ b/BERT/reader/pretraining.py @@ -78,7 +78,7 @@ class DataReader(object): def parse_line(self, line, max_seq_len=512): """ 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!" (token_ids, sent_ids, pos_ids, label) = line token_ids = [int(token) for token in token_ids.split(" ")] -- GitLab