All Projects → sz128 → few_shot_slot_tagging_and_NER

sz128 / few_shot_slot_tagging_and_NER

Licence: other
PyTorch implementation of the paper: Vector Projection Network for Few-shot Slot Tagging in Natural Language Understanding. Su Zhu, Ruisheng Cao, Lu Chen and Kai Yu.

Programming Languages

python
139335 projects - #7 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to few shot slot tagging and NER

LearningToCompare-Tensorflow
Tensorflow implementation for paper: Learning to Compare: Relation Network for Few-Shot Learning.
Stars: ✭ 17 (+0%)
Mutual labels:  few-shot-learning
viewpoint-mining
参考NER,基于BERT的电商评论观点挖掘和情感分析
Stars: ✭ 31 (+82.35%)
Mutual labels:  ner
NER BiLSTM CRF Chinese
BiLSTM_CRF中文实体命名识别
Stars: ✭ 46 (+170.59%)
Mutual labels:  ner
2020CCF-NER
2020 CCF大数据与计算智能大赛-非结构化商业文本信息中隐私信息识别-第7名方案
Stars: ✭ 66 (+288.24%)
Mutual labels:  ner
deep-atrous-ner
Deep-Atrous-CNN-NER: Word level model for Named Entity Recognition
Stars: ✭ 35 (+105.88%)
Mutual labels:  ner
Meta-GDN AnomalyDetection
Implementation of TheWebConf 2021 -- Few-shot Network Anomaly Detection via Cross-network Meta-learning
Stars: ✭ 22 (+29.41%)
Mutual labels:  few-shot-learning
Black-Box-Tuning
ICML'2022: Black-Box Tuning for Language-Model-as-a-Service
Stars: ✭ 99 (+482.35%)
Mutual labels:  few-shot-learning
wink-ner
Language agnostic named entity recognizer
Stars: ✭ 32 (+88.24%)
Mutual labels:  ner
matching-networks
Matching Networks for one-shot learning in tensorflow (NIPS'16)
Stars: ✭ 54 (+217.65%)
Mutual labels:  few-shot-learning
deviation-network
Source code of the KDD19 paper "Deep anomaly detection with deviation networks", weakly/partially supervised anomaly detection, few-shot anomaly detection
Stars: ✭ 94 (+452.94%)
Mutual labels:  few-shot-learning
FSL-Mate
FSL-Mate: A collection of resources for few-shot learning (FSL).
Stars: ✭ 1,346 (+7817.65%)
Mutual labels:  few-shot-learning
renet
[ICCV'21] Official PyTorch implementation of Relational Embedding for Few-Shot Classification
Stars: ✭ 72 (+323.53%)
Mutual labels:  few-shot-learning
Awesome-Few-Shot-Image-Generation
A curated list of papers, code and resources pertaining to few-shot image generation.
Stars: ✭ 209 (+1129.41%)
Mutual labels:  few-shot-learning
WARP
Code for ACL'2021 paper WARP 🌀 Word-level Adversarial ReProgramming. Outperforming `GPT-3` on SuperGLUE Few-Shot text classification. https://aclanthology.org/2021.acl-long.381/
Stars: ✭ 66 (+288.24%)
Mutual labels:  few-shot-learning
Awesome-Weak-Shot-Learning
A curated list of papers, code and resources pertaining to weak-shot classification, detection, and segmentation.
Stars: ✭ 142 (+735.29%)
Mutual labels:  few-shot-learning
naacl2019-select-pretraining-data-for-ner
BiLSTM-CRF model for NER
Stars: ✭ 15 (-11.76%)
Mutual labels:  ner
simple NER
simple rule based named entity recognition
Stars: ✭ 29 (+70.59%)
Mutual labels:  ner
presidio-research
This package features data-science related tasks for developing new recognizers for Presidio. It is used for the evaluation of the entire system, as well as for evaluating specific PII recognizers or PII detection models.
Stars: ✭ 62 (+264.71%)
Mutual labels:  ner
ner-d
Python module for Named Entity Recognition (NER) using natural language processing.
Stars: ✭ 14 (-17.65%)
Mutual labels:  ner
Zero-shot-Fact-Verification
Codes for ACL-IJCNLP 2021 Paper "Zero-shot Fact Verification by Claim Generation"
Stars: ✭ 39 (+129.41%)
Mutual labels:  few-shot-learning

Few-Shot Slot Tagging and NER

This is the PyTorch implementation of the paper: Vector Projection Network for Few-shot Slot Tagging in Natural Language Understanding. Su Zhu, Ruisheng Cao, Lu Chen and Kai Yu. [PDF]

We achieve a new state-of-the-art of few-shot slot tagging on SNIPS and NER datasets.

Requirements

  • pytorch >= 1.4.0
  • transformers >= 3.3.1

Data

Download the SNIPS and NER dataset formatted as episodes.

❱❱❱ bash prepare_data.sh

Data statistic:

❱❱❱ python3 data_utils/data_statistic.py --data_path data/xval_ner_shot_1_out_1

Training & Validation & Evaluation

  • We try ten different random seeds (999, 189, 114, 929, 290, 848, 538, 874, 295, 266) and report average F1 scores in the paper .
  • For other data splits, please change the dataset path as "xval_snips_shot_{1,5}_out_{1,2,3,4,5,6,7}" and "xval_ner_shot_{1,5}_out_{1,2,3,4}".
  • ProtoNet+CDT+VP:
bash run_few_shot_slot_tagger_protoNet_with_pure_bert.sh \
    --matching_similarity_y ctx \
    --matching_similarity_type xy1 \
    --matching_similarity_function dot \
    --test_finetune false \
    --dataset_name HIT_ner_shot_5_out_1 \
    --dataset_path ./data/xval_ner_shot_5_out_1 \
    --random_seed 999 \
    --model_removed no
  • L-ProtoNet+CDT+VP:
bash run_few_shot_slot_tagger_protoNet_with_pure_bert.sh \
    --matching_similarity_y ctx_desc \
    --matching_similarity_type xy1 \
    --matching_similarity_function dot \
    --test_finetune false \
    --dataset_name HIT_ner_shot_5_out_1 \
    --dataset_path ./data/xval_ner_shot_5_out_1 \
    --random_seed 999 \
    --model_removed no
  • ProtoNet+CDT+VPB:
bash run_few_shot_slot_tagger_protoNet_with_pure_bert.sh \
    --matching_similarity_y ctx \
    --matching_similarity_type xy \
    --matching_similarity_function euclidean2 \
    --test_finetune false \
    --dataset_name HIT_ner_shot_5_out_1 \
    --dataset_path ./data/xval_ner_shot_5_out_1 \
    --random_seed 999 \
    --model_removed no

You can refer to an example of saved log file which is produced by the above script.

  • L-ProtoNet+CDT+VPB:
bash run_few_shot_slot_tagger_protoNet_with_pure_bert.sh \
    --matching_similarity_y ctx_desc \
    --matching_similarity_type xy \
    --matching_similarity_function euclidean2 \
    --test_finetune false \
    --dataset_name HIT_ner_shot_5_out_1 \
    --dataset_path ./data/xval_ner_shot_5_out_1 \
    --random_seed 999 \
    --model_removed no

If you want to keep fine-tuning the model with the support set of the target domain after pre-training on source domains, please set "--test_finetune true".

Citation

This code has been written using PyTorch >= 1.4.0. If you use any source codes included in this toolkit in your work, please cite the following paper. The bibtex is listed below:

@article{zhu2020vector,
  title={Vector Projection Network for Few-shot Slot Tagging in Natural Language Understanding},
  author={Zhu, Su and Cao, Ruisheng and Chen, Lu and Yu, Kai},
  journal={arXiv preprint arXiv:2009.09568},
  year={2020}
}
@InProceedings{zhu2021few,
author="Zhu, Su and Chen, Lu and Cao, Ruisheng and Chen, Zhi and Miao, Qingliang and Yu, Kai",
title="Few-Shot NLU with Vector Projection Distance and Abstract Triangular CRF",
booktitle="Natural Language Processing and Chinese Computing",
year="2021",
pages="505--516",
}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].