This repository contains the code for replicating the analyses from the following paper:
White, A.S. 2020. On believing and hoping whether. Accepted with revisions to Semantics and Pragmatics.
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/on-believing-and-hoping-whether: Analysis Code for "On believing and hoping whether".
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. I 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', 'lme4'), repos='http://cran.us.r-project.org')
If you haven't already, download the code.
git clone https://github.com/MegaAttitude/on-believing-and-hoping-whether.git
To build the Docker image, use:
cd on-believing-and-hoping-whether
docker build -t on-believing-and-hoping-whether .
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 on-believing-and-hoping-whether on-believing-and-hoping-whether
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
two things within this directory:
On believing and hoping whether.ipynb
: the analysis codeplots/
: a directory for containing the plots generated byOn believing and hoping whether.ipynb
plots/
will be empty until you run the notebook.