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

NER 任务中出现KeyError报错 #117

Closed
ZZQ908268856 opened this issue Jun 15, 2022 · 19 comments
Closed

NER 任务中出现KeyError报错 #117

ZZQ908268856 opened this issue Jun 15, 2022 · 19 comments
Labels
question Further information is requested

Comments

@ZZQ908268856
Copy link

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.

@ZZQ908268856 ZZQ908268856 added the question Further information is requested label Jun 15, 2022
@tlk1997
Copy link
Collaborator

tlk1997 commented Jun 15, 2022

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

@ZZQ908268856
Copy link
Author

ZZQ908268856 commented Jun 15, 2022 via email

@tlk1997
Copy link
Collaborator

tlk1997 commented Jun 15, 2022

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

@ZZQ908268856
Copy link
Author

ZZQ908268856 commented Jun 15, 2022 via email

@tlk1997
Copy link
Collaborator

tlk1997 commented Jun 15, 2022

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

@ZZQ908268856
Copy link
Author

ZZQ908268856 commented Jun 15, 2022 via email

@tlk1997
Copy link
Collaborator

tlk1997 commented Jun 15, 2022

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

@ZZQ908268856
Copy link
Author

ZZQ908268856 commented Jun 15, 2022 via email

@tlk1997
Copy link
Collaborator

tlk1997 commented Jun 15, 2022

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

@ZZQ908268856
Copy link
Author

ZZQ908268856 commented Jun 15, 2022 via email

@ZZQ908268856
Copy link
Author

ZZQ908268856 commented Jun 16, 2022 via email

@tlk1997
Copy link
Collaborator

tlk1997 commented Jun 16, 2022

好,我下午看看

@tlk1997
Copy link
Collaborator

tlk1997 commented Jun 16, 2022

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

@ZZQ908268856
Copy link
Author

ZZQ908268856 commented Jun 16, 2022 via email

@tlk1997
Copy link
Collaborator

tlk1997 commented Jun 16, 2022

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

@ZZQ908268856
Copy link
Author

ZZQ908268856 commented Jun 16, 2022 via email

@tlk1997
Copy link
Collaborator

tlk1997 commented Jun 16, 2022

没问题,留个qq聊一下吧

@ZZQ908268856
Copy link
Author

ZZQ908268856 commented Jun 16, 2022 via email

@tlk1997 tlk1997 closed this as completed Jun 16, 2022
@liyueqing-tian
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants