Upload bert_tokenizer.py
Browse files- 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)
|