• Stars
    star
    103
  • Rank 331,166 (Top 7 %)
  • Language
    Python
  • Created almost 4 years ago
  • Updated over 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Code for AAAI2021 paper: Few-Shot Learning for Multi-label Intent Detection.

Few-shot MLC

The code of AAAI2021 paper Few-Shot Learning for Multi-label Intent Detection.

The code framework is based on few-shot learning platform: MetaDialog.

Get Started

Requirement

python >= 3.6
pytorch >= 1.5.0
transformers >= 2.8.0
allennlp >= 0.8.2
tqdm >= 4.33.0

Prepare pre-trained embedding:

BERT

Down the pytorch bert model, or convert tensorflow param yourself as follow:

export BERT_BASE_DIR=/users4/ythou/Projects/Resources/bert-base-uncased/uncased_L-12_H-768_A-12/

pytorch_pretrained_bert convert_tf_checkpoint_to_pytorch
  $BERT_BASE_DIR/bert_model.ckpt
  $BERT_BASE_DIR/bert_config.json
  $BERT_BASE_DIR/pytorch_model.bin

Set BERT path in the ./utils/config.py

Prepare data

Get data at ./data/

Set test, train, dev data file path in ./scripts/

Full data is available by contacting me, or you can generate it by your self:

Few-shot Data Generation Tool

We provide a generation tool for converting normal data into few-shot/meta-episode style. See details at here

Run!

Execute the command line to run with scripts:

source ./scripts/run_b_stanford_1_main.sh [gpu_id]

We provide all scripts for experiment at ./scripts/, and you can also directly run with ./main.py.

bert based scripts:

  • run_b_stanford_1_main.sh
  • run_b_stanford_5_main.sh
  • run_b_toursg_1_main.sh
  • run_b_toursg_5_main.sh

electra based scripts:

  • run_e_stanford_1_main.sh
  • run_e_stanford_5_main.sh
  • run_e_toursg_1_main.sh
  • run_e_toursg_5_main.sh

[2020-12-28] add script to generate tag_dict.all file

  • script: scripts/get_tag_data_from_training_dataset.py
  • operation:
    • change the parameters called MODEL_DIR and DATA_DIR
  • command: python scripts/get_tag_data_from_training_dataset.py

More Repositories

1

Task-Oriented-Dialogue-Research-Progress-Survey

A datasets and methods survey about task-oriented dialogue, including recent datasets and SOTA leaderboards.
1,239
star
2

MetaDialog

Platform for few-shot natural language processing: Text Classification, Sequene Labeling.
Python
219
star
3

FewShotTagging

Code for ACL2020 paper: Few-shot Slot Tagging with Collapsed Dependency Transfer and Label-enhanced Task-adaptive Projection Network
Python
153
star
4

Seq2SeqDataAugmentationForLU

This repo is code for the COLING 2018 paper: Sequence-to-sequence Data Augmentation for Dialogue Language Understanding.
Python
77
star
5

PromptSlotTagging

Code for ACL22 findings paper: Inverse is Better! Fast and Accurate Prompt for Slot Tagging
Python
26
star
6

Pascal-Simple-Compiler

哈工大编译原理实验 编译器
C++
16
star
7

Bi-LSTM_PosTagger

An easy-to-use sequence labeling project(get SoA on ATIS data) with pytorch
Python
15
star
8

FewShotJoint

Python
12
star
9

UserSimulator

Code for CCL 2019 BEST Poster Paper: A Corpus-free State2Seq User Simulator for Task-oriented Dialogue
OpenEdge ABL
7
star
10

Sequence-to-Sequence-User-Simulator

Python
6
star
11

atma

Light NLP Tool: atma-0.4.1, commonly-used & tested NLP tools: sentence level bleu, tokenizer, proxy crawler included
Python
6
star
12

HIT-secondary-trading-platform-

哈工大二手交易平台
HTML
6
star
13

NNlearning

This repo contains code solution for Stanford CS224N natural language class, and some project relative code.
Python
2
star
14

simple_BP

A simple 3-3-4 three layer neural network for HIT PR homework2
Python
2
star
15

BigPrimeNumber

MSRA homework, implement a big integer packet and generate the k th prime.
C++
1
star
16

Parzen-Window-And-Top-K

Machine Learning non-parameter method: Parzen window and Top-k
Python
1
star
17

git_homework

A good example of Django development ,which is HIT Software Engineering's homework
1
star
18

scene2

for homework
Python
1
star
19

CruelWorld

Game & Machine-Learning attempt?
Python
1
star
20

scene1

for homework scene
HTML
1
star