GithubHelp home page GithubHelp logo

gregorywu / pairscl Goto Github PK

View Code? Open in Web Editor NEW

This project forked from thu-bpm/pairscl

0.0 0.0 0.0 45 KB

The source code of paper "PAIR-LEVEL SUPERVISED CONTRASTIVE LEARNING FOR NATURAL LANGUAGE INFERENCE"

License: MIT License

Python 100.00%

pairscl's Introduction

PairSCL - pair-level supervised contrastive learning

The source code of paper "PAIR-LEVEL SUPERVISED CONTRASTIVE LEARNING FOR NATURAL LANGUAGE INFERENCE" published at ICASSP 2022.

Environments

pytorch=1.8.1, transformers=4.2.1

Fetch the data to train and test the model

fetch_data.py [-h] [--dataset_url DATASET_URL]
              [--target_dir TARGET_DIR]

Preprocess the data

preprocess_*.py [-h] [--config CONFIG]

Train the encoder

python main_supcon.py  --epoch EPOCH --batch_size BatchSize --dataset Dataset --dist-url tcp://localhost:10001 --multiprocessing-distributed --world-size 1 --rank 0 

Train the classifier

python main_validate.py --dataset Dataset --ckpt pathToModel --dist-url tcp://localhost:10001 --multiprocessing-distributed --world-size 1 --rank 0

Test the model

python main_test.py --dataset Dataset --gpu GPU --ckpt_bert pathToEncoder --ckpt_classifier pathToClassifier

Reference

If the code is used in your research, hope you can cite our paper as follows:

@INPROCEEDINGS{9746499,
  author={Li, Shu’ang and Hu, Xuming and Lin, Li and Wen, Lijie},
  booktitle={ICASSP 2022 - 2022 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP)}, 
  title={Pair-Level Supervised Contrastive Learning for Natural Language Inference}, 
  year={2022},
  volume={},
  number={},
  pages={8237-8241},
  doi={10.1109/ICASSP43922.2022.9746499}}

pairscl's People

Contributors

thulishuang avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.