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模型预测为空 #160

Closed
ume-technology opened this issue Oct 19, 2022 · 8 comments
Closed

NER模型预测为空 #160

ume-technology opened this issue Oct 19, 2022 · 8 comments
Labels
question Further information is requested

Comments

@ume-technology
Copy link

Describe the question

我标注了一些数据,但是无论怎样,执行predict后,预测的实体都是空。甚至尝试预测了train data中的一条数据,结果同样为空。
我使用是 standard NER模型。
使用的预训练模型是在配置文件中是这样的,配置在文件夹的这里:\conf\hydra\model\bert.yaml,在这个文件中配置了我本地的pre model

我不清楚是哪里出了问题。

Environment (please complete the following information):

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

Screenshots

If applicable, add screenshots to help explain your problem.

Additional context

Add any other context about the problem here.

@ume-technology ume-technology added the question Further information is requested label Oct 19, 2022
@zxlzr
Copy link
Contributor

zxlzr commented Oct 20, 2022

请问您标注了多少数据,模型训练需要大约数千条样本。

@ume-technology
Copy link
Author

可能是我的训练集太少了,几百条的量,但是为什么测试train data 也是空呢?

@zxlzr
Copy link
Contributor

zxlzr commented Oct 20, 2022

如果train 也是空的话建议您打印loss看一下,是否学习率等超参数设置的不合理,loss 如果一直下降的话多跑几个epoch 是可以对train 预测出结果的

@ume-technology
Copy link
Author

我再查看一下代码吧。因为是我一个人标注,我之后会尝试一些弱标注的方案。这批数据集我在wandb上查看loss,发现有飙升的情况。因此已经尝试过设定新的epochs和学习率,但是traindata没有预测结果的情况依然没有改变。另外我认为已经是traindata了,和学习率已经没关系了,但是我没有找到问题的原因在哪里。总之感谢您的帮助,有不懂的再来请教。感谢。

@ume-technology
Copy link
Author

另外请问,学习率是配置文件中的哪个参数,我怕我是不是该错位置了。

@zxlzr
Copy link
Contributor

zxlzr commented Oct 20, 2022

learning_rate: 1e-3

@zxlzr zxlzr closed this as completed Oct 20, 2022
@qinglongheu
Copy link

Describe the question

我标注了一些数据,但是无论怎样,执行predict后,预测的实体都是空。甚至尝试预测了train data中的一条数据,结果同样为空。
我使用是 standard NER模型。
使用的预训练模型是在配置文件中是这样的,配置在文件夹的这里:\conf\hydra\model\bert.yaml,在这个文件中配置了我本地的pre model

我不清楚是哪里出了问题。

Environment (please complete the following information):

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

Screenshots

If applicable, add screenshots to help explain your problem.

Additional context

Add any other context about the problem here.

这个可能是应为你模型预测出的结果都是‘o’即没有识别出per, org等自己设计的标签, 建议换一下predict的文本数据。

@ume-technology
Copy link
Author

ume-technology commented Dec 13, 2022 via email

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