Giter Club home page Giter Club logo

metnet's Introduction

Meta-Learning Triplet Network with Adaptive Margins for Few-Shot Named Entity Recognition

This repository contains the code and data for our paper:

Meta-Learning Triplet Network with Adaptive Margins for Few-Shot Named Entity Recognition

If you find this work useful and use it on your own research, please cite our paper.

@article{han2023meta,
  title={Meta-Learning Triplet Network with Adaptive Margins for Few-Shot Named Entity Recognition},
  author={Chengcheng Han and 
          Renyu Zhu and 
          Jun Kuang and 
          FengJiao Chen and
          Xiang Li and
          Ming Gao and
          Xuezhi Cao and
          Wei Wu},
  journal={arXiv preprint arXiv:2302.07739},
  year={2023}
}

Overview

We propose an improved triplet network with adaptive margins (MeTNet) and a new inference procedure for few-shot NER.

We release the first Chinese few-shot NER dataset FEW-COMM.

Data

The datasets used by our experiments are in the data/ folder, including FEW-COMM, FEW-NERD, WNUT17, Restaurant and Multiwoz.

FEW-COMM is a Chinese few-shot NER dataset we released, which consists of 66,165 product description texts that merchants display on a large e-commerce platform, including 140,936 entities and 92 pre-defined entity types. These entity types are various commodity attributes that are manually defined by domain experts, such as "material", "color" and "origin". Please see Appendix C of our paper for more details on the dataset.

Quickstart

Our code will be open-sourced soon. You can use Few-COMM in your experiments. The data format of FEW-COMM is the same as that of FEW-NERD, so you can use the DataLoader in FEW-NERD. Currently, the benchmarks on the FEW-COMM dataset are as follows:

FEW-COMM 5-way 1-shot 5-way 5-shot 10-way 1-shot 10-way 5-shot
MAML 28.16 54.38 26.23 44.66
NNShot 48.40 71.55 41.75 67.91
StructShot 48.61 70.62 47.77 65.09
PROTO 22.73 53.95 22.17 45.81
CONTaiNER 57.13 63.38 51.87 60.98
ESD 65.37 73.29 58.32 70.93
DecomMETA 68.01 72.89 62.13 72.14
SpanProto 70.97 76.59 63.94 74.67
MeTNet 71.89 78.14 65.11 77.58

If you have the latest experimental results on the FEW-COMM dataset, please contact us to update the benchmark.

Dependencies

  • Python 3.8
  • nltk>=3.6.4
  • numpy==1.21.0
  • pandas==1.3.5
  • torch==1.7.1
  • transformers==4.0.1
  • apex==0.9.10dev
  • scikit_learn==0.24.1
  • seqeval

Attribution

Parts of this code are based on the following repositories:

metnet's People

Contributors

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