bojone / bert4keras

keras implement of transformers for humans
https://kexue.fm/archives/6915
Apache License 2.0
5.37k stars 927 forks source link

P=1,R=0,F1=0 #422

Open MonkeyTB opened 2 years ago

MonkeyTB commented 2 years ago

https://github.com/bojone/bert4keras/blob/3267076addae915db70545bc9d4da193ce895103/examples/task_relation_extraction.py#L329 苏神,麻烦请教下,再用这个代码和之前您做的seq2seq DGCNN的那个,都会出现标题的情况,之前的代码我又改动,bert这个版本没有改动,但都是同样的结果,劳请猜测下,哪里出问题了,实在是看不出来了,数据集是官网下载的

/home/jovyan/.conda/envs/tf-2.1/lib/python3.7/site-packages/bert4keras/optimizers.py:943: RuntimeWarning: divide by zero encountered in true_divide ema_weights = [weight / scale for weight in ema_weights] /home/jovyan/.conda/envs/tf-2.1/lib/python3.7/site-packages/bert4keras/optimizers.py:943: RuntimeWarning: invalid value encountered in true_divide ema_weights = [weight / scale for weight in ema_weights] f1: 0.00000, precision: 1.00000, recall: 0.00000: : 21626it [05:52, 61.42it/s] f1: 0.00000, precision: 1.00000, recall: 0.00000, best f1: 0.00000

bojone commented 2 years ago

用tf 1.x + keras试试