Skip to content


Folders and files

Last commit message
Last commit date

Latest commit



14 Commits

Repository files navigation

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 with any comments/problems/questions/suggestions.


  • 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 (downloads character interaction dataset, metadata info, and 300d GloVe embeddings pretrained on the Common Crawl, and then runs to train an RMN on the downloaded dataset)

visualizing learned trajectories

  • Running 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 to generate visualizations like the ones below:

if you use this code, please cite:

	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},


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


relationship modeling networks (NAACL 2016)







No releases published


No packages published