iioSnail commited on
Commit
f76a1c9
·
1 Parent(s): 78daf2e

Upload bert_tokenizer.py

Browse files
Files changed (1) hide show
  1. bert_tokenizer.py +1 -1
bert_tokenizer.py CHANGED
@@ -143,7 +143,7 @@ class ChineseBertTokenizer(BertTokenizerFast):
143
  pinyin_ids.append([0] * 8)
144
  continue
145
 
146
- pinyin_string = pinyin(token, style=Style.TONE3, errors=lambda x: [['not chinese'] for _ in x])[0]
147
 
148
  if pinyin_string == "not chinese":
149
  pinyin_ids.append([0] * 8)
 
143
  pinyin_ids.append([0] * 8)
144
  continue
145
 
146
+ pinyin_string = pinyin(token, style=Style.TONE3, errors=lambda x: [['not chinese'] for _ in x])[0][0]
147
 
148
  if pinyin_string == "not chinese":
149
  pinyin_ids.append([0] * 8)