This repository contains the code for replicating the analyses from the following paper:
White, A.S. and K. Rawlins. 2020. Frequency, Acceptability, and Selection: A case study of clause-embedding. Accepted to Glossa.
If you use any of the code found in this directory, please cite that paper as well as this repository.
White, A.S. 2020. MegaAttitude/frequency-acceptability-selection: Analysis Code for "Frequency, Acceptability, and Selection". Zenodo. http://doi.org/10.5281/zenodo.3744712
A Docker image specification is provided in the form of a Dockerfile. It is strongly recommended that you run the notebook containing the analysis code using a container based on this image. Failure to do so could result in minor differences in statistics from the published paper or inability to run the code at all due to API changes. Issues that do not explicitly state that they pertain to the Docker image we have supplied will be automatically closed, and analogous inquiries will be ignored.
It is important that you have allocated at least 8GB of RAM to Docker prior to building the image or running the notebook. Failure to allocate enough memory will result in often cryptic errors on build or run.
If it is impossible for you to use Docker, you should at least set up
a virtual environment using Anaconda or one of the many python
facilities available. We have provided a requirements.txt
file to
facilitate this. This file is generated using pip freeze
from within
a container based on the supplied Docker image specification. In
addition to the packages specified in that file, you will need an R
installation and a few R packages for generating plots.
install.packages(c('tidyverse', 'reshape2', 'lme4', 'ggrepel'), repos='http://cran.us.r-project.org')
If you haven't already, download the code.
git clone https://github.com/MegaAttitude/frequency-acceptability-selection.git
To build the Docker image, use:
cd frequency-acceptability-selection
docker build -t frequency-acceptability-selection .
This image is based on a standard
jupyter/datascience-notebook
image. It is only slightly modified, and so much of the
documentation
for that image remains relevant.
To start a container based on this image, use:
docker run -p 8888:8888 --name frequency-acceptability-selection frequency-acceptability-selection
The notebook server can then be accessed in the standard way.
Following the convention used by Jupyter's Docker images, the server
initially points to the /home/jovyan/work/
directory. You should see
three things within this directory:
Frequency, Acceptability, and Selection.ipynb
: the analysis codeplots/
: a directory containing the plots generated byFrequency, Acceptability, and Selection.ipynb
data/
: a directory containing objects cached byFrequency, Acceptability, and Selection.ipynb
Both plots/
and data/
will be empty until you run the notebook.