Giter Site home page Giter Site logo

yaxincui / swcc4event Goto Github PK

View Code? Open in Web Editor NEW

This project forked from imgaojun/swcc4event

0.0 0.0 0.0 86 KB

Code for our ACL2022 paper "Improving Event Representation via Simultaneous Weakly Supervised Contrastive Learning and Clustering".

Shell 0.31% Python 99.69%

swcc4event's Introduction

SWCC: a Simultaneous Weakly supervised Contrastive learning and Clustering framework for event representation learning.


Official implementation of our paper "Improving Event Representation via Simultaneous Weakly Supervised Contrastive Learning and Clustering".

Note.

The Event triples we use for the training data are extracted from the New York Times Gigaword Corpus using the Open Information Extraction system Ollie. Our event representation model is implemented using the Texar-PyTorch package. Our model starts from pre-trained checkpoints of BERT-based-uncased and we use the CLS token representation as the event representation. We train our model with a batch size of $256$ using an Adam optimizer. The learning rate is set as 2e-7 for the event representation model and 5e-4 for the prototype memory. We adopt the temperature $\tau=0.3$ and the number of prototypes used in our experiment is $10$.

Dataset

We recommend using gdown to download our data from Google Drive:

pip install gdown
gdown https://drive.google.com/u/0/uc?id=1FSZq0HM_rS2GKt0IDoMZlh6REytVrtFi&export=download

Quick Start

conda create -n swcc python=3.8
conda activate swcc
pip install -r requirements.txt

Training/Testing

To train and test a specific model, run the bash files train.sh and test.sh. For example, to train a new model and test a specific model, do the following:

// Training
// sh train.sh
CUDA_VISIBLE_DEVICES=0 python3 main.py --do-train 

// Testing
//sh test.sh
CUDA_VISIBLE_DEVICES=3 python3 main.py --do-eval --checkpoint ./models/checkpoint.pt 

Citation

@inproceedings{gao2022improving,
 author = {Jun Gao and Wei Wang and Changlong Yu and Huan Zhao and Wilfred Ng and Ruifeng Xu},
 booktitle = {Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics},
 title = {Improving Event Representation via Simultaneous Weakly Supervised Contrastive Learning and Clustering},
 year = {2022}
}

swcc4event's People

Contributors

imgaojun avatar jgao95 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.