Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ProHiryu/bert-chinese-ner
使用预训练语言模型BERT做中文NER
https://github.com/ProHiryu/bert-chinese-ner
bert chinese fine-tune ner tensorflow
Last synced: 6 days ago
JSON representation
使用预训练语言模型BERT做中文NER
- Host: GitHub
- URL: https://github.com/ProHiryu/bert-chinese-ner
- Owner: ProHiryu
- License: mit
- Created: 2018-11-28T02:18:54.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2020-02-26T05:58:03.000Z (over 4 years ago)
- Last Synced: 2024-08-02T08:09:59.074Z (3 months ago)
- Topics: bert, chinese, fine-tune, ner, tensorflow
- Language: Python
- Homepage:
- Size: 3.64 MB
- Stars: 924
- Watchers: 26
- Forks: 276
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-bert - ProHiryu/bert-chinese-ner
- awesome-transformer-nlp - ProHiryu/bert-chinese-ner - Use the pre-trained language model BERT to do Chinese NER. (Tasks / Named-Entity Recognition (NER))
README
# bert-chinese-ner
## 前言
使用预训练语言模型BERT做中文NER尝试,fine - tune BERT模型
PS: 移步最新[**albert fine-tune ner**](https://github.com/ProHiryu/albert-chinese-ner)模型
## 代码参考
- [BERT-NER](https://github.com/kyzhouhzau/BERT-NER)
- [BERT-TF](https://github.com/google-research/bert)## 使用方法
从[BERT-TF](https://github.com/google-research/bert)下载bert源代码,存放在路径下bert文件夹中
从[BERT-Base Chinese](https://storage.googleapis.com/bert_models/2018_11_03/chinese_L-12_H-768_A-12.zip)下载模型,存放在checkpoint文件夹下
使用BIO数据标注模式,使用人民日报经典数据
train:
`python BERT_NER.py --data_dir=data/ --bert_config_file=checkpoint/bert_config.json --init_checkpoint=checkpoint/bert_model.ckpt --vocab_file=vocab.txt --output_dir=./output/result_dir/`
## 结果
经过100个epoch跑出来的结果
```
eval_f = 0.9662649
eval_precision = 0.9668882
eval_recall = 0.9656949
global_step = 135181
loss = 40.160034
```测试结果第一句:
![](test.png)