Coder Social home page Coder Social logo

gabbage / coherence-models-for-dialogue Goto Github PK

View Code? Open in Web Editor NEW

This project forked from alecervi/coherence-models-for-dialogue

0.0 1.0 0.0 18.74 MB

This is the repository for the Interspeech 2018 paper "Coherence models for dialogue".

Python 100.00%

coherence-models-for-dialogue's Introduction

Coherence-models-for-dialogue

This is the repository for the Interspeech 2018 paper "Coherence models for dialogue" . If you use our code, please cite our paper:

Cervone, A., Stepanov, E.A., & Riccardi, G. (2018). Coherence Models for Dialogue. Interspeech.

Prerequisites

  • python 2.7+
  • spacy version 1
  • tqdm
  • mlxtend

The code generates input feature vectors files for SVM light version 6.02, so in order to finally train the models you will need to install that as well.

Data preprocessing

The data used in the experiments (i.e. only the grid files, since source corpora are under licenses) is available in the data folder. Furthermore, the scripts we used to generate the data from source corpora is available. See the README file in the data/ folder for further details. The corpora preprocessing step in the corpus folder is a modification of the scripts from this library.

Where do I find the source corpora used in the experiments?

Getting started

Generate features vectors with the provided data

After having unzipped the file data/data.zip (the data used in our experiments), you can directly generate the feature vectors for SVM light for the corpus Oasis with default parameters:

python train_models.py -g Oasis

You can find the generated feature vector files in the newly created path experiments/Oasis/reordering/egrid_-coref/ , divided according to the train/dev/test splits.

Train

Then, to train a model using SVM light you can run:

svm_learn -z p experiments/Oasis/reordering/egrid_-coref/Oasis_sal1_range2_2_train.dat my_model

Predict

To classify the test set using your newly trained model:

svm_classify experiments/Oasis/reordering/egrid_-coref/Oasis_sal1_range2_2_test.dat my_model my_prediction

Evaluate

Finally, to get the accuracy and other metrics reported in our paper for the newly trained model on the testset:

python eval_svmlight_output.py --testfile experiments/Oasis/reordering/egrid_-coref/Oasis_sal1_range2_2_test.dat --predfile my_prediction

If you don't specify the file with the model's predictions (--predfile), the script reports the performance of a random baseline on the testset using the same metrics:

python eval_svmlight_output.py --testfile experiments/Oasis/reordering/egrid_-coref/Oasis_sal1_range2_2_test.dat

Data generation from the corpus

For generating grids for training entity grid models using only entities (without coreference) for the corpus Oasis (provided you gave the correct path to the Oasis source files) in verbose mode:

python generate_grid.py Oasis egrid_-coref egrid_-coref data/ -v

After having generated the original grids, generate shuffled grids (for the reordering task) for the same corpus:

python generate_shuffled.py -gs Oasis

Link to our experiments files

You can get all our experiments files (obtained with the above procedure) here

coherence-models-for-dialogue's People

Contributors

alecervi avatar gabbage avatar

Watchers

James Cloos 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.