DSXiangLi / ChineseNER

中文NER的那些事儿
306 stars 58 forks source link

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

Open copypastejun opened 2 years ago

copypastejun commented 2 years ago

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_2wv.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 commented 2 years ago

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

LinJingOK commented 2 years ago

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_2wv.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'

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