hankcs / HanLP

Natural Language Processing for the next decade. Tokenization, Part-of-Speech Tagging, Named Entity Recognition, Syntactic & Semantic Dependency Parsing, Document Classification

Home Page:https://hanlp.hankcs.com/en/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

a bug

huangyang66 opened this issue · comments

Describe the bug
运行recongnizer = hanlp.load(hanlp.pretrained.ner.MSRA_NER_ALBERT_BASE_ZH)时报错

Failed to load https://file.hankcs.com/hanlp/ner/msra_ner_albert_base_20211228_173323.zip
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 below.
================================ERROR LOG BEGINS================================
OS: Windows-10-10.0.22621-SP0
Python: 3.9.13
PyTorch: 2.0.1+cu118
TensorFlow: 2.13.0
HanLP: 2.1.0-beta.50

RuntimeError: Failed to import transformers.models.albert.modeling_tf_albert because of the following error (look up to see its traceback):
No module named 'keras.engine'

Code to reproduce the issue
import hanlp
recongnizer = hanlp.load(hanlp.pretrained.ner.MSRA_NER_ALBERT_BASE_ZH)

Describe the current behavior
已经成功下载了模型,但是在加载的时候报错
hanlp版本为2.1.0b50

Expected behavior
希望能够将下载的模型加载进来使得代码能够成功运行

System information
================================ERROR LOG BEGINS================================
OS: Windows-10-10.0.22621-SP0
Python: 3.9.13
PyTorch: 2.0.1+cu118
TensorFlow: 2.13.0
HanLP: 2.1.0-beta.50

Other info / logs
源代码:
import hanlp
recongnizer = hanlp.load(hanlp.pretrained.ner.MSRA_NER_ALBERT_BASE_ZH)

  • I've completed this form and searched the web for solutions.