Skip to content

thunlp/HATT-Proto

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Hybrid Attention-Based Prototypical Networks for Noisy Few-Shot Relation Classification

Code and data for AAAI2019 paper Hybrid Attention-Based Prototypical Networks for Noisy Few-Shot Relation Classification.

Author: Tianyu Gao*, Xu Han*, Zhiyuan Liu, Maosong Sun. (* means equal contribution)

Dataset and Word Embedding

We evaluate our models on FewRel, a large-scale dataset for few-shot relation classification. It has 100 relations and 700 instances for each relation. You can find some baseline models from here.

Due to the large size, we did not upload the glove file (pre-trained word embedding). Please download glove.6B.50d.json from Tsinghua Cloud or Google Drive and put it under data/ folder.

Usage

To run our code, use this command for training

python train.py {MODEL_NAME} {N} {K} {NOISE_RATE}

and use this command for testing

python test.py {MODEL_NAME} {N} {K} {NOISE_RATE}

where {MODEL_NAME} could be proto or proto_hatt, {N} is the num of classes, {K} is the num of instances for each class and {NOISE_RATE} is the probability that one instance is wrong-labeled.

About

Code and dataset of AAAI2019 paper Hybrid Attention-Based Prototypical Networks for Noisy Few-Shot Relation Classification

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages