Giter VIP home page Giter VIP logo

ner_biaffine_bert's Introduction

NER_Biaffine_Bert

概述

1、论文复现《Named Entity Recognition as Dependency Parsing》。使用双仿射注意力机制Biaffine的**来进行命名实体识别。
2、模型的具体思路描述可以见知乎
3、训练数据来自于MSRA命名实体识别训练语料,已经做相应的修改转换。

环境要求

pytorch >=1.6.0
transformers>=3.4.0

运行步骤

1、去huggingface官网下载BERT预训练权重,然后并放在./pretrained_model/文件夹下
2、在./utils/arguments_parse.py中修改BERT预训练模型的路径
3、运行train.py进行训练
4、运行predict.py进行预测

项目结构

│  eval_func.py  
│  LICENSE
│  predict.py            #预测脚本
│  README.md     
│  train.py              #训练脚本
│
├─checkpoints
├─data                   #数据
│      test.json         
│      train.json
│
├─data_preprocessing
│      data_prepro.py
│      tools.py
│
├─log
├─model
│  │  model.py            #模型结构
│  │
│  ├─loss_function        #损失函数
│  │      binary_cross_entropy.py
│  │      cross_entropy_loss.py
│  │      focal_loss.py
│  │      multilabel_cross_entropy.py
│  │      span_loss.py
│  │
│  └─metrics               #测评函数
│          metrics.py
│
├─output                   #输出文件,预测得到的结果放在这里
│      result.json
│
├─pretrained_model         #改文件夹用来存放预训练模型
│  └─chinese_roberta_wwm_ext
└─utils
        arguments_parse.py  #设置模型训练相关的参数
        logger.py           #存放日志等脚本

ner_biaffine_bert's People

Contributors

yangruixia avatar

Watchers

Kostas Georgiou avatar  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.