Skip to content

Accompanies the paper "Learnability and Semantic Universals" ; trains recurrent neural networks to learn to verify sentences with quantifiers in order to explain semantic universals

License

Notifications You must be signed in to change notification settings

jckend/lexicalization-rnn-learning

Repository files navigation

Learnability and Semantic Universals

This repository accompanies the following paper:

In particular, we attempt to explain semantic universals surrounding quantifiers by training a recurrent neural network (a long-short term memory network specifically) to learn quantifiers, some satisfying proposed universals and some not. Generally, we find that those satisfying universals are easier to learn by this model than those that do not.

This repository contains all the code needed to replicate the experiments reported in that paper. It also contains the data and figures from the experiments that we ran and which are reported therein.

Requirements

Python 2.7, TensorFlow 1.4+, Pandas

I plan to make the code compatible with Python 3 soon.

Running Experiments

Any of the experiments can be re-run very simply from the command-line. For example, to run experiment 1(a):

python quant_verify.py --exp one_a --out_path /tmp/exp1a/

Note that the output written to out_path will also contain checkpoints and other data from TensorFlow in addition to CSV files recording the relevant information from each trial.

Analyzing Data

To analyze the output from an experiment, use the analysis.experiment_analysis method. It takes two arguments: a path to a directory containing the CSV files output by a run of an experiment, and an array containing the names of quantifiers in the experiment.

To re-create the analysis from the paper and the figures included therein, you can use the predefined methods. For example, in a Python shell:

import analysis
analysis.experiment_one_a_analysis()

About

Accompanies the paper "Learnability and Semantic Universals" ; trains recurrent neural networks to learn to verify sentences with quantifiers in order to explain semantic universals

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 69.0%
  • Jupyter Notebook 31.0%