Skip to content
Code for the EMNLP 2019 paper: Event Representation Learning Enhanced with External Commonsense Knowledge.
Python Scala Shell
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
data add datasets Aug 23, 2019
event_tensors init Aug 23, 2019
preproc init Aug 23, 2019
.gitignore init Aug 23, 2019
README.md fix link Aug 26, 2019
dataset.py init Aug 23, 2019
eval_hard_similarity.py init Aug 23, 2019
eval_transitive_sentence_similarity.py init Aug 23, 2019
joint_train_on_atomic.py init Aug 23, 2019
model.py init Aug 23, 2019
requirements.txt add requirements.txt Aug 23, 2019
train_event_prediction_on_nyt.py init Aug 23, 2019
train_word_prediction_on_nyt.py

README.md

Commonsense Event Representation

This repository contains code for the EMNLP 2019 paper: Event Representation Learning Enhanced with External Commonsense Knowledge.

Requirements

  • Java 1.7, Scala 2.9.0 (for preprocessing NYT corpus)

  • Python3

Data

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.

Preprocessing

See this.

Train

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.py Pretrain the event representation model on the NYT corpus with "event prediction" objective.

  • train_word_prediction_on_nyt.py Pretrain 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.py Train the event representation model on the ATOMIC dataset, with additional intent prediction and sentiment classification objective.

Test

For the hard similarity task, run this script:

  • eval_hard_similarity.py

For the transitive sentence similarity task, run this script:

  • eval_transitive_sentence_similarity.py

For the script event prediction task, see this repository.

Models

The best model for each task can be downloaded here.

You can’t perform that action at this time.