GithubHelp home page GithubHelp logo

bert-ner's Introduction

Bert-NER

Introduction

该项目是基于谷歌开源的BERT预训练模型,在中文NER任务上进行fine-tune

Datasets & Model

预训练的中文BERT模型及代码来自于Google Research的bert

Results

引入bert之后,可以看到在验证集上的F-1值在训练了16个epoch时就已经达到了94.87,并在测试集上达到了93.68,在这个数据集上的F-1值提升了两个多百分点。

Train

  1. 下载bert模型代码,放入本项目根目录
  2. 下载bert的中文预训练模型,解压放入本项目根目录
  3. 搭建依赖环境python3 + tensorflow >= 1.12
  4. 执行python train.py即可训练模型
  5. 执行python predict.py可以对单句进行测试

整理后的项目目录,应如图所示。

Conclusion

可以看到,使用bert以后,模型的精度提升了两个多百分点。并且,在后续测试过程中发现,使用bert训练的NER模型拥有更强的泛化性能,比如训练集中未见过的公司名称等,都可以很好的识别, 基本上解决OOV问题。

bert-ner's People

Contributors

impltrait avatar

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.