zjunlp / DeepKE

[EMNLP 2022] An Open Toolkit for Knowledge Graph Extraction and Construction

Home Page:http://deepke.zjukg.cn/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

NER 任务中出现KeyError报错

ZZQ908268856 opened this issue · comments

Describe the question

A clear and concise description of what the question is.
NER 任务中,换成自己的标注数据集进行训练时会出现KeyError报错:KeyError: 'B-Disease'。
我已经在get_labels函数中添加了训练集中的标注标签,还是未能解决此问题,希望大佬给予帮助。

Environment (please complete the following information):

  • OS: [e.g. mac / window]
  • Python Version [e.g. 3.6]
    Linux
    python 3.8

Screenshots

If applicable, add screenshots to help explain your problem.
image

Additional context

Add any other context about the problem here.

你好,在最开始安装依赖包的时候,如果通过pip install deepke的形式安装,修改的代码是不会生效的,得通过python setup.py install的方式才能生效

有通过pip install deepke的方式安装过么,如果有的话需要讲之前装的卸载掉再重新安装

可以在这报错之前,print(label_list)看看

其他地方就没需要改的了,你可以上传你的代码到自己仓库,我再看一看

训练数据能传一小部分上去吗

好,我下午看看

我用你数据和给的代码是可以跑通的,修改后代码是不是没在运行python setup.py develop?

是的,在linux和mac环境下都跑了没问题

没问题,留个qq聊一下吧

在NER任务中,执行python run_bert.py 会报网络错误Connection to huggingface.co timed out('HTTPSConnectionPool(host='huggingface.co', port=443):), 请问如果换成镜像要修改那个配置吗?如果已经将bert-base-chinese模型下载本地,请问要在哪里修改配置路径吗?