Commonsense Event Representation
This repository contains code for the EMNLP 2019 paper: Event Representation Learning Enhanced with External Commonsense Knowledge.
Java 1.7, Scala 2.9.0 (for preprocessing NYT corpus)
The original hard similarity dataset, the hard similarity dataset annotated by us, and the transitive sentence similarity dataset are released together with the code. The file format is processed for convenience.
NYT, ATOMIC and other datasets need to be downloaded separately.
The pretrained word embedding can be downloaded here. We add embeddings for word "PersonX" and "PersonY" to the original Glove word embedding.
First, pretrain the event representation model on the NYT corpus using the method described in the AAAI 2018 paper Event Representations with Tensor-based Compositions (run either of the scripts below).
train_event_prediction_on_nyt.pyPretrain the event representation model on the NYT corpus with "event prediction" objective.
train_word_prediction_on_nyt.pyPretrain the event representation model on the NYT corpus with "word prediction" objective.
After pretraining on the NYT corpus, train the event representation model on the ATOMIC dataset, using the following script:
joint_train_on_atomic.pyTrain the event representation model on the ATOMIC dataset, with additional intent prediction and sentiment classification objective.
For the hard similarity task, run this script:
For the transitive sentence similarity task, run this script:
For the script event prediction task, see this repository.
The best model for each task can be downloaded here.