Skip to content

Code implementation for the paper "Enhancing Contrastive Learning with Noise-Guided Attack: Towards Continual Relation Extraction in the Wild".

Notifications You must be signed in to change notification settings

CuteyThyme/Noisy-CRE

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Enhancing Contrastive Learning with Noise-Guided Attack: Towards Continual Relation Extraction in the Wild

This repository contains the official PyTorch implementation for the following paper:

Enhancing Contrastive Learning with Noise-Guided Attack: Towards Continual Relation Extraction in the Wild

Environment

Create an environment with the following commands:

conda create --name cre python=3.8
conda activate cre
pip install -r requirements.txt

Datasets

All the training and test datasets can be found in the folder data/

  • FewRel relevant data file:

    • data_with_marker.json
    • data_with_marker_train.json
    • data_with_marker_val.json
    • data_with_marker_test.json
    • data_with_marker_train_noise_0.1.json
    • data_with_marker_train_noise_0.3.json
    • data_with_marker_train_noise_0.5.json
    • id2rel.json
  • TACRED relevant data file:

    • data_with_marker_tacred.json
    • data_with_marker_tacred_train.json
    • data_with_marker_tacred_test.json
    • data_with_marker_tacred_train_noise_0.1.json
    • data_with_marker_tacred_train_noise_0.3.json
    • data_with_marker_tacred_train_noise_0.5.json
    • id2rel_tacred.json

Sample Commands for Running

python -u run_continual.py \
    --gpu 0 \
    --dataname Tacred \
    --lr2 2e-5 \
    --learning_rate 2e-5 \
    --noise_rate 0.1 \ 
    --total_round 1 \
    --hidden \
    --thresh 0.8 \
    --split_steps 3 \
    --margin 0 \
    --amc \
    --temp 0.1

About

Code implementation for the paper "Enhancing Contrastive Learning with Noise-Guided Attack: Towards Continual Relation Extraction in the Wild".

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages