All Projects → WenRichard → NER-FunTool

WenRichard / NER-FunTool

Licence: MIT License
本NER项目包含多个中文数据集,模型采用BiLSTM+CRF、BERT+Softmax、BERT+Cascade、BERT+WOL等,最后用TFServing进行模型部署,线上推理和线下推理。

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to NER-FunTool

ChineseNER
中文NER的那些事儿
Stars: ✭ 241 (+330.36%)
Mutual labels:  bert, chinese-ner
Text and Audio classification with Bert
Text Classification in Turkish Texts with Bert
Stars: ✭ 34 (-39.29%)
Mutual labels:  bert
bern
A neural named entity recognition and multi-type normalization tool for biomedical text mining
Stars: ✭ 151 (+169.64%)
Mutual labels:  bert
LightLM
高性能小模型测评 Shared Tasks in NLPCC 2020. Task 1 - Light Pre-Training Chinese Language Model for NLP Task
Stars: ✭ 54 (-3.57%)
Mutual labels:  bert
bert tokenization for java
This is a java version of Chinese tokenization descried in BERT.
Stars: ✭ 39 (-30.36%)
Mutual labels:  bert
TorchBlocks
A PyTorch-based toolkit for natural language processing
Stars: ✭ 85 (+51.79%)
Mutual labels:  bert
SQUAD2.Q-Augmented-Dataset
Augmented version of SQUAD 2.0 for Questions
Stars: ✭ 31 (-44.64%)
Mutual labels:  bert
chinese-nlp-ner
一套针对中文实体识别的BLSTM-CRF解决方案
Stars: ✭ 14 (-75%)
Mutual labels:  chinese-ner
CoronaXiv
First Prize in HackJaipur Hackathon 2020 for Best ElasticSearch-based Product! Website: http://coronaxiv2.surge.sh/#/
Stars: ✭ 15 (-73.21%)
Mutual labels:  bert
ALBERT-Pytorch
Pytorch Implementation of ALBERT(A Lite BERT for Self-supervised Learning of Language Representations)
Stars: ✭ 214 (+282.14%)
Mutual labels:  bert
Medi-CoQA
Conversational Question Answering on Clinical Text
Stars: ✭ 22 (-60.71%)
Mutual labels:  bert
robo-vln
Pytorch code for ICRA'21 paper: "Hierarchical Cross-Modal Agent for Robotics Vision-and-Language Navigation"
Stars: ✭ 34 (-39.29%)
Mutual labels:  bert
bert experimental
code and supplementary materials for a series of Medium articles about the BERT model
Stars: ✭ 72 (+28.57%)
Mutual labels:  bert
KAREN
KAREN: Unifying Hatespeech Detection and Benchmarking
Stars: ✭ 18 (-67.86%)
Mutual labels:  bert
bert sa
bert sentiment analysis tensorflow serving with RESTful API
Stars: ✭ 35 (-37.5%)
Mutual labels:  bert
WSDM-Cup-2019
[ACM-WSDM] 3rd place solution at WSDM Cup 2019, Fake News Classification on Kaggle.
Stars: ✭ 62 (+10.71%)
Mutual labels:  bert
bert quora question pairs
BERT Model Fine-tuning on Quora Questions Pairs
Stars: ✭ 28 (-50%)
Mutual labels:  bert
textgo
Text preprocessing, representation, similarity calculation, text search and classification. Let's go and play with text!
Stars: ✭ 33 (-41.07%)
Mutual labels:  bert
text2class
Multi-class text categorization using state-of-the-art pre-trained contextualized language models, e.g. BERT
Stars: ✭ 15 (-73.21%)
Mutual labels:  bert
Quality-Estimation2
机器翻译子任务-翻译质量评价-在BERT模型后面加上Bi-LSTM进行fine-tuning
Stars: ✭ 31 (-44.64%)
Mutual labels:  bert

NER实验及模型部署

本NER项目包含多个中文数据集,模型采用BiLSTM+CRF、BERT+Softmax、BERT+Cascade、BERT+WOL等,其中BiLSTM+CRF部分采用的字符向量为BERT字向量,最后在CLUE_NER数据集上进行实验对比,并采用TFServing进行模型部署进行线上推理和线下推理。

详细请见知乎:
NER实战:从实验到BERT模型部署服务

运行环境
python 3.6
tensorflow 1.14

如何运行?以运行BERT+CRF模型为例

  • step1:模型训练
    python run_bert_crf.py
  • step2:模型验证测试
    python predict_bert_crf.py
  • step3:模型推理预测
    python infer_online.py

模型评价方式 对于NER模型,评判模型是否好坏的方法有2种

  • 标签评价法:对模型预测的标签进行评价,计算预测标签和原始标签的p,r,f1值
    tag_evaluating.py 其中可以设置是否不把O标签考虑在内
  • 实体评价法:对预测的实体进行评价,计算预测实体的f1值等等
    entity_evaluating.py

模型推理模模式

一、基于checkpoints进行online,offline推理预测
1.dev_offline 预测标签与真实标签评价结果+预测实体与真实实体评价结果+写入评测文件
2.predict_online 识别即时输入句子的实体
3.predict_offline 预测结果写入文件,提交比赛结果,本项目对应于clue的ner预测标准文件格式

二、基于tfserving + pb文件进行online,offline推理预测

模型推理部分,分为本地载入模型推理或者tensorflow serving grpc 推理,具体详见 infer_online.py 和 infer_offline.py

实验结果

model precision recall f1 entity_f1 epoch predict_time
clue_ner lstm_crf 0.926 0.865 0.890 0.671 20
bert_crf 0.871 0.820 0.840 0.741 3
bert_wol 0.900 0.851 0.874 0.800 3
casecade_lstm_crf 0.942 0.891 0.916 0.783 20
casecade_bert_crf 0.892 0.842 0.866 0.800 3

TODO
1.加上ALBERT,ROBERTA等预训练语言模型
2.在模型中融合入词向量等特征信息

Cite
如果你在研究中使用了NER-FunTool,请按如下格式引用:

@software{NER-FunTool,
  author = {ZhengWen Xie},
  title = {NER-FunTool: A Fun Tool for Chinese NER},
  year = {2021},
  url = {https://github.com/WenRichard/NER-FunTool},
}

Reference
1.NER
2.CLUE_NER
3.NerAdapter

欢迎Fork和Star!也欢迎提交PR!
留言请在Issues或者email [email protected]

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].