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

ctb.50d.vec文件没找到。 data/msra/preprocess.py #8

Open
copypastejun opened this issue Jan 29, 2022 · 2 comments
Open

ctb.50d.vec文件没找到。 data/msra/preprocess.py #8

copypastejun opened this issue Jan 29, 2022 · 2 comments

Comments

@copypastejun
Copy link

Traceback (most recent call last):
File "/XXXXX/ChineseNER-main/data/msra/preprocess.py", line 46, in
prep = get_instance(tokenizer, MAX_SEQ_LEN, TAG2IDX, MAPPING, word_enhance)
File "/XXXXX/ChineseNER-main/data/base_preprocess.py", line 90, in get_instance
instance = cls(tokenizer_type, max_seq_len, tag2idx, mapping, **kwargs)
File "/XXXXX/ChineseNER-main/data/base_preprocess.py", line 342, in init
ctb50_handler.init()# init词表
File "/XXXXX/ChineseNER-main/data/word_enhance.py", line 50, in init
self.model = getattr(importlib.import_module(self.model_dir), 'model')
File "/anaconda/lib/python3.6/importlib/init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 978, in _gcd_import
File "", line 961, in _find_and_load
File "", line 950, in _find_and_load_unlocked
File "", line 655, in _load_unlocked
File "", line 678, in exec_module
File "", line 205, in _call_with_frames_removed
File "/XXXXX/ChineseNER-main/pretrain_model/ctb50/init.py", line 5, in
model = convert('ctb50/ctb.50d.vec')
File "/XXXXX/ChineseNER-main/pretrain_model/glove_2_wv.py", line 18, in convert
_ = glove2word2vec(glove_file, tmp_file)
File "/anaconda/lib/python3.6/site-packages/gensim/scripts/glove2word2vec.py", line 104, in glove2word2vec
num_lines, num_dims = get_glove_info(glove_input_file)
File "/anaconda/lib/python3.6/site-packages/gensim/scripts/glove2word2vec.py", line 81, in get_glove_info
with utils.open(glove_file_name, 'rb') as f:
File "/anaconda/lib/python3.6/site-packages/smart_open/smart_open_lib.py", line 195, in open
newline=newline,
File "/anaconda/lib/python3.6/site-packages/smart_open/smart_open_lib.py", line 361, in _shortcut_open
return _builtin_open(local_path, mode, buffering=buffering, **open_kwargs)
FileNotFoundError: [Errno 2] No such file or directory: '/XXXXX/ChineseNER-main/pretrain_model/ctb50/ctb.50d.vec'

@DSXiangLi
Copy link
Owner

DSXiangLi commented Jan 30, 2022

请仔细阅读每个子folder的readme,pretrain_model里面有写需要下载的模型和链接

@LinJingOK
Copy link

Traceback (most recent call last): File "/XXXXX/ChineseNER-main/data/msra/preprocess.py", line 46, in prep = get_instance(tokenizer, MAX_SEQ_LEN, TAG2IDX, MAPPING, word_enhance) File "/XXXXX/ChineseNER-main/data/base_preprocess.py", line 90, in get_instance instance = cls(tokenizer_type, max_seq_len, tag2idx, mapping, **kwargs) File "/XXXXX/ChineseNER-main/data/base_preprocess.py", line 342, in init ctb50_handler.init()# init词表 File "/XXXXX/ChineseNER-main/data/word_enhance.py", line 50, in init self.model = getattr(importlib.import_module(self.model_dir), 'model') File "/anaconda/lib/python3.6/importlib/init.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 978, in _gcd_import File "", line 961, in _find_and_load File "", line 950, in _find_and_load_unlocked File "", line 655, in _load_unlocked File "", line 678, in exec_module File "", line 205, in _call_with_frames_removed File "/XXXXX/ChineseNER-main/pretrain_model/ctb50/init.py", line 5, in model = convert('ctb50/ctb.50d.vec') File "/XXXXX/ChineseNER-main/pretrain_model/glove_2_wv.py", line 18, in convert _ = glove2word2vec(glove_file, tmp_file) File "/anaconda/lib/python3.6/site-packages/gensim/scripts/glove2word2vec.py", line 104, in glove2word2vec num_lines, num_dims = get_glove_info(glove_input_file) File "/anaconda/lib/python3.6/site-packages/gensim/scripts/glove2word2vec.py", line 81, in get_glove_info with utils.open(glove_file_name, 'rb') as f: File "/anaconda/lib/python3.6/site-packages/smart_open/smart_open_lib.py", line 195, in open newline=newline, File "/anaconda/lib/python3.6/site-packages/smart_open/smart_open_lib.py", line 361, in _shortcut_open return _builtin_open(local_path, mode, buffering=buffering, **open_kwargs) FileNotFoundError: [Errno 2] No such file or directory: '/XXXXX/ChineseNER-main/pretrain_model/ctb50/ctb.50d.vec'

你好,你复现代码了吗,我的环境还是一直有问题?

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