SoftMaskedBert icon indicating copy to clipboard operation
SoftMaskedBert copied to clipboard

测试模型是不是错了

Open lewispony opened this issue 2 years ago • 1 comments

        corrector_correct = corrector_correct + sum(
            [(output * batch_mask).reshape(-1)[j].equal((batch_out_ids * batch_mask).reshape(-1)[j])
             for j in range(len(output.reshape(-1)))])

纠错和检测模型两个统计方式这里为什么还要reshape(-1),这岂不是一个个token进行比对?本人放入数据进行训练,把最后的输出数据打印进行比对,发现输出跟正确内容差别很大,不知道题主有没有详细看过

lewispony avatar Jun 06 '22 08:06 lewispony

确实是一个个对比的; 不过这里乘了个mask, 所以序列的补零部分被认为预测正确, 会导致准确率偏高; 至于实际输出, 我已经在公司业务里落地应用了, 你觉得输出不准的话, 这个需要仔细排查

quantum00549 avatar Jun 07 '22 07:06 quantum00549