FlorianPfisterer / scs-baselines

Baseline models for the paper: "Modeling Naive Psychology of Characters in Simple Commonsense Stories" by Hannah Rashkin, Antoine Bosselut, Maarten Sap, Kevin Knight and Yejin Choi

Home Page:https://uwnlp.github.io/storycommonsense/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Story Commonsense Baselines

Classifiying common sense emotional and motivational states in stories

Installation

Starting from whatever directory you will be placing the scs-baselines repository, run the following commands:

git clone git@github.com:atcbosselut/scs-baselines.git
cd scs-baselines
wget http://homes.cs.washington.edu/~antoineb/datasets/scs-baselines-data-noids.tar.gz
tar -xvzf scs-baselines-data.tar.gz
cd ..

These dependencies must also be installed. Apart from Jobman, they should be available from a typical package manager such as anaconda or pip:

  • python2.7
  • progressbar2
  • pandas
  • pytorch3.1
  • nltk
  • Jobman

Installing Jobman

Instructions for installing Jobman are a bit convoluted, so just run the following commands from your home directory and you should be fine:

git clone git://git.assembla.com/jobman.git Jobman
cd jobman
python setup.py install

Making Data

Run the following command from the working directory.

bash make_data.sh

Running experiments

Training a classification model

To run a classification model run the following command:

python src/main_class.py

This command will load the configuration settings in the config/class_config.json file and run a model according to these parameters. The src/config.py source file explains what each variable in this configuration file does.

Training a generation model

To run a generation model, run the following command:

python src/main_gen.py

This command will load the configuration settings in the config/gen_config.json file and run a model according to these parameters. The src/config.py source file explains what each variable in this configuration file does.

Training a classification model with a pretrained generation model

To run a classification model using a model pretrained on generation, do the following. First, initialize an entry in the config/pretrained_config.json JSON configuration file whose key is "load_model_${MODEL_TYPE}_${TASK}" where $TASK is one of motivation or emotion and ${MODEL_TYPE} is a class of model such as lstm, cnn, ren, or npn. An example is provided in the configuration file. Then, run the following command:

python src/main_pretrained.py

This command will load the configuration settings in the config/pretrained_config.json file and run a model according to these parameters. The src/config.py source file explains what each variable in this configuration file does.

Evaluating a model on the test set

Set the load_model_name value in the config/class_config.json file. Then run the following command:

python src/evaluate_test.py

Contact

Feel free to reach out with questions to antoineb@cs.washington.edu

About

Baseline models for the paper: "Modeling Naive Psychology of Characters in Simple Commonsense Stories" by Hannah Rashkin, Antoine Bosselut, Maarten Sap, Kevin Knight and Yejin Choi

https://uwnlp.github.io/storycommonsense/

License:MIT License


Languages

Language:Python 100.0%