pytorch jax bert fill-mask zh transformers autotrain_compatible
---
language: zh
---









# Based on bert-base-chinese

基于bert-base-chinese在`message80W`数据集（垃圾邮件二分类）上做了5个epoch的fine-tune



```python
# evaluate
with torch.no_grad():
    model.eval()
    eval_steps = 0
    pred_list = []
    label_list = []
    for i, batch in enumerate(tqdm(test_loader)):
        input_ids, attention_mask, label = batch
        logits = model(input_ids, attention_mask)
        pred_list += (torch.argmax(logits, dim=-1))
        label_list += label
        eval_steps += 1
```



80W数据，shuffled，8：3分train  eval

下面是eval结果

![image-20220512153415505](image-20220512153415505.png)







