zjunlp / DeepKE

[EMNLP 2022] An Open Toolkit for Knowledge Graph Extraction and Construction
http://deepke.zjukg.cn/
MIT License
3.6k stars 694 forks source link

deepke训练模型,训练完成精度始终为0 #595

Open humengzi opened 1 month ago

humengzi commented 1 month ago

Describe the bug

A clear and concise description of what the bug is. 我用的是bert模型,所有的配置项都没改,然后batch_size设为64,epoch50,数据集采用的也是官网文档推荐的数据集,目前训练的是ner任务。然后我用自建数据集测试过也是全为0,我想问是不是某个参数设置的不对

Environment (please complete the following information):

Screenshots

If applicable, add screenshots to help explain your problem. 这是loss曲线 image

Additional context

Add any other context about the problem here.

humengzi commented 1 month ago

opt/conda/lib/python3.8/site-packages/seqeval/metrics/v1.py:57: UndefinedMetricWarning: Precision and F-score are ill-defined and being set to 0.0 in labels with no predicted samples. Use zero_division parameter to control this behavior. _warn_prf(average, modifier, msg_start, len(result)) /opt/conda/lib/python3.8/site-packages/seqeval/metrics/v1.py:57: UndefinedMetricWarning: Precision and F-score are ill-defined and being set to 0.0 due to no predicted samples. Use zero_division parameter to control this behavior. _warn_prf(average, modifier, msg_start, len(result)) [2024-10-22 03:07:42,471][main][INFO] - precision recall f1-score support

     LOC       0.00      0.00      0.00      1799
     ORG       0.00      0.00      0.00       976
     PER       0.00      0.00      0.00       882

micro avg 0.00 0.00 0.00 3657 macro avg 0.00 0.00 0.00 3657 weighted avg 0.00 0.00 0.00 3657

[2024-10-22 03:07:42,472][main][INFO] - Eval results [2024-10-22 03:07:42,472][main][INFO] - precision recall f1-score support

     LOC       0.00      0.00      0.00      1799
     ORG       0.00      0.00      0.00       976
     PER       0.00      0.00      0.00       882

micro avg 0.00 0.00 0.00 3657 macro avg 0.00 0.00 0.00 3657 weighted avg 0.00 0.00 0.00 3657

Timmy-love-you commented 1 month ago

我也发现了,怎么训练都毫无效果。

humengzi commented 1 month ago

我现在已经自己解决了: 1、要么你不要使用bert模型训练,可以使用lstmcrf去做,效果还可以 2、如果坚持使用bert模型训练的话,可以设置use_wandb为True,然后监控一下模型的loss曲线,找到最佳的epoch 同时,自建数据集可以适当降低学习率

------------------ 原始邮件 ------------------ 发件人: "zjunlp/DeepKE" @.>; 发送时间: 2024年11月1日(星期五) 下午2:51 @.>; @.**@.>; 主题: Re: [zjunlp/DeepKE] deepke训练模型,训练完成精度始终为0 (Issue #595)

我也发现了,怎么训练都毫无效果。

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

zxlzr commented 1 month ago

抱歉,可能我们readme没写清楚导致您训练遇到一些不便。如果您还有其他问题欢迎随时交流