# MeTNet **Repository Path**: chen_di/MeTNet ## Basic Information - **Project Name**: MeTNet - **Description**: Meta-Learning Triplet Network with Adaptive Margins for Few-Shot Named Entity Recognition - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2023-07-01 - **Last Updated**: 2023-07-01 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 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*](https://arxiv.org/pdf/2302.07739) 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](https://ningding97.github.io/fewnerd/). 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: - [FewNERD](https://github.com/thunlp/Few-NERD) - [MLADA](https://github.com/hccngu/MLADA)