Skip to content

Commit

Permalink
Update json2text.py
Browse files Browse the repository at this point in the history
  • Loading branch information
hirofumi0810 committed Jun 26, 2019
1 parent e58070d commit 2baa793
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions utils/json2text.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ def get_parser():

for x in j['utts']:
seq = [char_list[int(i)] for i in j['utts'][x]['output'][0]['rec_tokenid'].split()]
h.write(" ".join(seq).replace('<eos>', '') + '\n')
h.write(x + " " + " ".join(seq).replace('<eos>', '') + '\n')

seq = [char_list[int(i)] for i in j['utts'][x]['output'][0]['tokenid'].split()]
r.write(" ".join(seq).replace('<eos>', '') + '\n')
if 'tokenid' in j['utts'][x]['output'][0].keys():
seq = [char_list[int(i)] for i in j['utts'][x]['output'][0]['tokenid'].split()]
r.write(x + " " + " ".join(seq).replace('<eos>', '') + '\n')

0 comments on commit 2baa793

Please sign in to comment.