Giter Club home page Giter Club logo

rmn's Introduction

Relationship Modeling Networks (RMN)

Code for model described in Feuding Families and Former Friends: Unsupervised Learning for Dynamic Fictional Relationships along with a dataset of character interactions. Feel free to email me at [email protected] with any comments/problems/questions/suggestions.

dependencies:

  • python 2, numpy, theano, lasagne
  • recommended to train w/ GPU, on a 980 Ti each epoch takes 2-3 minutes

dataset description:

  • 20,046 relationships with 387,614 total spans from 1,378 different books
  • each span is provided in a bag-of-words format where stopwords and infrequent words have been filtered out as described in the paper

download data and train model:

  • bash run.sh (downloads character interaction dataset, metadata info, and 300d GloVe embeddings pretrained on the Common Crawl, and then runs train_rmn.py to train an RMN on the downloaded dataset)

visualizing learned trajectories

  • Running train_rmn.py yields three output files: the model parameters (rmn_params.pkl), the learned descriptors (descriptors.log), and the learned trajectories (trajectories.log). Before generating visualizations, you need to manually label each descriptor (each line in the descriptor file). You can do this by simply inserting your labels as the first word of each line in the descriptor file.
  • After labeling the descriptors, run viz.py to generate visualizations like the ones below:

if you use this code, please cite:

@inproceedings{IyyerRelationships,
	Author = {Mohit Iyyer and Anupam Guha and Snigdha Chaturvedi and Jordan Boyd-Graber and Hal {Daum\'{e} III}},
	Booktitle = {North American Association for Computational Linguistics},
	Location = {San Diego, CA},
	Year = {2016},
	Title = {Feuding Families and Former Friends: Unsupervised Learning for Dynamic Fictional Relationships},
}

to-dos:

  • clean and integrate the alpha tuning code
  • better comment RMN hyperparams and add argparse

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.