Git Product home page Git Product logo

ner-demo's Introduction

NER-demo

Method

1.HMM
https://github.com/kifish/NER-demo/tree/hmm
2.CRF
https://github.com/kifish/NER-demo/tree/crf
3.BiLSTM-viterbi
https://github.com/kifish/NER-demo/tree/BiLSTM-viterbi
4.BiLSTM-CRF
https://github.com/kifish/NER-demo/tree/BiLSTM-crf
5.BiLSTM-CNN-CRF
https://github.com/kifish/NER-demo/tree/BiLSTM-cnn-crf
Update:
6.BERT-Softmax
https://github.com/kifish/NER-demo/tree/bert
7.BERT-CRF
https://github.com/kifish/NER-demo/tree/bert

See more

http://nlpprogress.com/english/named_entity_recognition.html

Experiment

Environment

python3.6+ (according to the branch)
pip install -r requirements.txt (according to the branch)
(use pip install git+https://www.github.com/keras-team/keras-contrib.git to install keras-contrib)

Result

	            precision	   recall        f1-score	   support
BERT                   0.9458      0.9090          0.9263             6195
BERT-CRF               0.9338      0.8901          0.9097             6195
BiLSTM-CRF	       0.8616      0.7138	   0.7806	      6181
BiLSTM-CNN-CRF	       0.8406	   0.7185	   0.7686	      6181
CRF	               0.8420	   0.6279	   0.7170	      6181
BiLSTM-viterbi	       0.8512	   0.5700	   0.6809	      6181
HMM	               0.4911	   0.4341	   0.4479	      6181

注: bert做数据预处理的实现和之前的模型不一样, 有一些出入, 导致support有差异, 待对齐。

Analysis

Todo

ner-demo's People

Contributors

kifish avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

ner-demo's Issues

解码问题

在预测的时候,您的代码怎么完成解码的呢?貌似没看到这部分?

IndexError: index -100 is out of bounds for dimension 0 with size 9

I tried to use your class BertCRFForNER_v3(BertPreTrainedModel) in this notebook: https://github.com/huggingface/notebooks/blob/main/examples/token_classification.ipynb

Unfortunately, I get the following error message: IndexError: index -100 is out of bounds for dimension 0 with size 9

Could you maybe help me further what I would have to change so that I can use BERTCRF instead of the AutoModelForTokenClassification.

Thanks in advance! I would really appreciate your help.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.