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

训练中在train和val数据上f1正常,但是在test数据上f1得分特低 #20

Open
LittleBenXi opened this issue Nov 19, 2019 · 2 comments

Comments

@LittleBenXi
Copy link

LittleBenXi commented Nov 19, 2019

训练得分

2019-11-19 10:20:56,050:INFO: Epoch 14/20
2019-11-19 11:34:31,893:INFO: - Train metrics: loss: 00.00; f1: 96.55
2019-11-19 11:42:04,513:INFO: - Val metrics: loss: 00.01; f1: 95.67
2019-11-19 11:42:11,501:INFO: Best val f1: 98.54

测试得分

2019-11-19 14:29:30,180:INFO: Starting evaluation...
2019-11-19 14:36:44,370:INFO: - Test metrics: loss: 14.14; f1: 00.02
2019-11-19 14:36:53,070:INFO:              precision    recall  f1-score   support

       prop       0.01      0.63      0.02     42707
      parts       0.04      0.01      0.01     96256
      model       0.01      0.03      0.01     23660

avg / total       0.03      0.18      0.02    162623

训练和测试都是用的evaluate.py, 为什么会出现这种情况

@lemonhu
Copy link
Owner

lemonhu commented Nov 19, 2019

谢谢关注。
根据你所给的结果,不太好直接给出结论,一个可能的原因是训练时的标签顺序编码tag2idx和测试时不一样。

@LittleBenXi
Copy link
Author

谢谢关注。
根据你所给的结果,不太好直接给出结论,一个可能的原因是训练时的标签顺序编码tag2idx和测试时不一样。

的确是标签顺序的问题,train和test的tag2id不对应。已经搞定了,谢谢!很棒的项目!

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

No branches or pull requests

2 participants