wgwang / ccks2020-baseline

CCKS 2020: 基于本体的金融知识图谱自动化构建技术评测

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

hanlp failed to load MSRA_NER_BERT_BASE_ZH

sliu018lss opened this issue · comments

hanlp version:2.0.0-alpha.68
python version: 3.8.0
CentOS Linux release 8.2.2004 (Core)

python3.8
Python 3.8.0 (default, May 7 2020, 02:49:39)
[GCC 8.3.1 20191121 (Red Hat 8.3.1-5)] on linux
Type "help", "copyright", "credits" or "license" for more information.

import hanlp
recognizer = hanlp.load(hanlp.pretrained.ner.MSRA_NER_BERT_BASE_ZH)
Failed to load https://file.hankcs.com/hanlp/ner/ner_bert_base_msra_20200104_185735.zip. See traceback below:
================================ERROR LOG BEGINS================================
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/hanlp/utils/component_util.py", line 48, in load_from_meta_file
obj.load(save_dir, **load_kwargs)
File "/usr/local/lib/python3.8/site-packages/hanlp/common/component.py", line 244, in load
self.build(**merge_dict(self.config, training=False, logger=logger, **kwargs, overwrite=True, inplace=True))
File "/usr/local/lib/python3.8/site-packages/hanlp/common/component.py", line 254, in build
self.model = self.build_model(**merge_dict(self.config, training=kwargs.get('training', None),
File "/usr/local/lib/python3.8/site-packages/hanlp/components/taggers/transformers/transformer_tagger.py", line 36, in build_model
model, tokenizer = build_transformer(transformer, max_seq_length, len(self.transform.tag_vocab), tagging=True)
File "/usr/local/lib/python3.8/site-packages/hanlp/layers/transformers/loader.py", line 44, in build_transformer
assert len(vocab) == 1, 'No vocab found or unambiguous vocabs found'
AssertionError: No vocab found or unambiguous vocabs found
=================================ERROR LOG ENDS=================================
Please upgrade hanlp with:
pip install --upgrade hanlp

If the problem still persists, please submit an issue to https://github.com/hankcs/HanLP/issues
When reporting an issue, make sure to paste the FULL ERROR LOG above.

I have tried ‘pip3 install --upgrade hanlp’ , it does't work.
Could you please help take a look at it? Thanks in advance.