Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

请问这里编码方式应该是什么呀? #52

Closed
chastelover opened this issue Dec 20, 2019 · 1 comment
Closed

请问这里编码方式应该是什么呀? #52

chastelover opened this issue Dec 20, 2019 · 1 comment

Comments

@chastelover
Copy link

如题,运行出错,查询的资料没有找到解决办法
Traceback (most recent call last):
File "BERT_NER.py", line 621, in
tf.app.run()
File "C:\Program Files\Anaconda3\lib\site-packages\tensorflow\python\platform\app.py", line 125, in run
_sys.exit(main(argv))
File "BERT_NER.py", line 518, in main
train_examples = processor.get_train_examples(FLAGS.data_dir)
File "BERT_NER.py", line 176, in get_train_examples
self._read_data(os.path.join(data_dir, "train.txt")), "train"
File "BERT_NER.py", line 153, in _read_data
for line in f:
UnicodeDecodeError: 'gbk' codec can't decode byte 0x93 in position 2: illegal multibyte sequence

@flyangovoyang
Copy link

there is a file reading function in class DataProcessor, just modify it in line 149 in BERT_NER.py by:
open(input_file, 'r', encoding='utf8') as f:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants