BERT NER Pytorch
1.0.0
Bert para o nerd chinês.
Atualização : 其他一些可以参考, 包括 Biaffine 、 GlobalPointer 等: Exemplos
Formato de entrada (prefira o esquema de tags do BIOS), com cada caractere seu rótulo para uma linha. As frases são divididas com uma linha nula.
美 B-LOC
国 I-LOC
的 O
华 B-PER
莱 I-PER
士 I-PER
我 O
跟 O
他 O
run_ner_xxx.py ou run_ner_xxx.sh .sh scripts/run_ner_xxx.shNota : Estrutura do arquivo do modelo
├── prev_trained_model
| └── bert_base
| | └── pytorch_model.bin
| | └── config.json
| | └── vocab.txt
| | └── ......
O desempenho geral de Bert no dev :
| Precisão (entidade) | Recall (entidade) | Pontuação F1 (entidade) | |
|---|---|---|---|
| Bert+softmax | 0,7897 | 0,8031 | 0,7963 |
| Bert+CRF | 0,7977 | 0,8177 | 0,8076 |
| Bert+span | 0,8132 | 0,8092 | 0,8112 |
| Bert+span+adv | 0,8267 | 0,8073 | 0,8169 |
| Bert-small (6 camadas)+span+kd | 0,8241 | 0,7839 | 0,8051 |
| Bert+span+focal_loss | 0,8121 | 0,8008 | 0,8064 |
| Bert+span+label_smoothing | 0,8235 | 0,7946 | 0,8088 |
O desempenho geral de Albert no Dev :
| modelo | versão | Precisão (entidade) | Recall (entidade) | F1 (entidade) | Hora do trem/época |
|---|---|---|---|---|---|
| Albert | base_google | 0,8014 | 0.6908 | 0,7420 | 0,75x |
| Albert | grande_google | 0,8024 | 0,7520 | 0,7763 | 2.1x |
| Albert | xlarge_google | 0,8286 | 0,7773 | 0,8021 | 6.7x |
| Bert | 0,8118 | 0,8031 | 0,8074 | ----- | |
| Albert | base_bright | 0,8068 | 0,7529 | 0,7789 | 0,75x |
| Albert | grande_bright | 0,8152 | 0,7480 | 0,7802 | 2.2x |
| Albert | xlarge_bright | 0,8222 | 0,7692 | 0,7948 | 7.3x |
O desempenho geral de Bert no dev (teste) :
| Precisão (entidade) | Recall (entidade) | Pontuação F1 (entidade) | |
|---|---|---|---|
| Bert+softmax | 0,9586 (0,9566) | 0,9644 (0,9613) | 0,9615 (0,9590) |
| Bert+CRF | 0,9562 (0,9539) | 0,9671 ( 0,9644 ) | 0,9616 (0,9591) |
| Bert+span | 0,9604 ( 0,9620 ) | 0,9617 (0,9632) | 0,9611 ( 0,9626 ) |
| Bert+span+focal_loss | 0,9516 (0,9569) | 0,9644 (0,9681) | 0,9580 (0,9625) |
| Bert+span+label_smoothing | 0,9566 (0,9568) | 0,9624 (0,9656) | 0,9595 (0,9612) |