Giter Club home page Giter Club logo

diffusionner's Introduction

DiffusionNER

Code for DiffusionNER: Boundary Diffusion for Named Entity Recognition, Yongliang Shen, Kaitao Song, Xu Tan, Dongsheng Li, Weiming Lu, Yueting Zhuang, ACL 2023.

During training, DiffusionNER gradually adds noises to the golden entity boundaries by a fixed forward diffusion process and learns a reverse diffusion process to recover the entity boundaries. In inference, DiffusionNER first randomly samples some noisy spans from a standard Gaussian distribution and then generates the named entities by denoising them with the learned reverse diffusion process.

Setup

To run our code, install:

conda create -n diffusionner python=3.8
pip install -r requirements.txt

Quick Start

Datasets

Nested NER:

Flat NER:

We provide the preprocessed datasets in these links: ACE2004, GENIA, CoNLL03, MSRA. Please download them and put them into the data/datasets folder.

If you need other datasets, please contact me ([email protected]) by email. Note that you need to state your identity and prove that you have obtained the license.

Training

Take the ACE2004 dataset as a demo and run:

CUBLAS_WORKSPACE_CONFIG=:4096:8 python diffusionner.py train --config configs/ace2004.conf

We also provide the pre-trained checkpoints in these links: ACE2004, GENIA, CoNLL03, MSRA. Please download them and put them into the data/checkpoints folder.

Evaluating

Set the path of the model checkpoint into eval.conf -> model_path and run:

CUBLAS_WORKSPACE_CONFIG=:4096:8 python diffusionner.py eval --config configs/eval.conf

Citation

If you find this repository useful, please cite our paper:

@article{Shen2023DiffusionNERBD,
  title={DiffusionNER: Boundary Diffusion for Named Entity Recognition},
  author={Yongliang Shen and Kaitao Song and Xu Tan and Dong Sheng Li and Weiming Lu and Yue Ting Zhuang},
  journal={ArXiv},
  year={2023},
  volume={abs/2305.13298}
}

Acknowledgement

denoising-diffusion-pytorch

diffusionner's People

Contributors

tricktreat 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.