Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Chinese NER(Named Entity Recognition) using BERT(Softmax, CRF, Span)

License

NotificationsYou must be signed in to change notification settings

lonePatient/BERT-NER-Pytorch

Repository files navigation

BERT for Chinese NER.

update:其他一些可以参考,包括Biaffine、GlobalPointer等:examples

dataset list

  1. cner: datasets/cner
  2. CLUENER:https://github.com/CLUEbenchmark/CLUENER

model list

  1. BERT+Softmax
  2. BERT+CRF
  3. BERT+Span

requirement

  1. 1.1.0 =< PyTorch < 1.5.0
  2. cuda=9.0
  3. python3.6+

input format

Input format (prefer BIOS tag scheme), with each character its label for one line. Sentences are splited with a null line.

美B-LOC国I-LOC的O华B-PER莱I-PER士I-PER我O跟O他O

run the code

  1. Modify the configuration information inrun_ner_xxx.py orrun_ner_xxx.sh .
  2. sh scripts/run_ner_xxx.sh

note: file structure of the model

├── prev_trained_model|  └── bert_base|  |  └── pytorch_model.bin|  |  └── config.json|  |  └── vocab.txt|  |  └── ......

CLUENER result

The overall performance of BERT ondev:

Accuracy (entity)Recall (entity)F1 score (entity)
BERT+Softmax0.78970.80310.7963
BERT+CRF0.79770.81770.8076
BERT+Span0.81320.80920.8112
BERT+Span+adv0.82670.80730.8169
BERT-small(6 layers)+Span+kd0.82410.78390.8051
BERT+Span+focal_loss0.81210.80080.8064
BERT+Span+label_smoothing0.82350.79460.8088

ALBERT for CLUENER

The overall performance of ALBERT ondev:

modelversionAccuracy(entity)Recall(entity)F1(entity)Train time/epoch
albertbase_google0.80140.69080.74200.75x
albertlarge_google0.80240.75200.77632.1x
albertxlarge_google0.82860.77730.80216.7x
bertgoogle0.81180.80310.8074-----
albertbase_bright0.80680.75290.77890.75x
albertlarge_bright0.81520.74800.78022.2x
albertxlarge_bright0.82220.76920.79487.3x

Cner result

The overall performance of BERT ondev(test):

Accuracy (entity)Recall (entity)F1 score (entity)
BERT+Softmax0.9586(0.9566)0.9644(0.9613)0.9615(0.9590)
BERT+CRF0.9562(0.9539)0.9671(0.9644)0.9616(0.9591)
BERT+Span0.9604(0.9620)0.9617(0.9632)0.9611(0.9626)
BERT+Span+focal_loss0.9516(0.9569)0.9644(0.9681)0.9580(0.9625)
BERT+Span+label_smoothing0.9566(0.9568)0.9624(0.9656)0.9595(0.9612)

About

Chinese NER(Named Entity Recognition) using BERT(Softmax, CRF, Span)

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2026 Movatter.jp