{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Course set-up" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "__author__ = \"Christopher Potts\"\n", "__version__ = \"CS224u, Stanford, Spring 2018 term\"" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "This notebook covers the steps you'll need to take to get set up for [CS224u](http://web.stanford.edu/class/cs224u/)." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Anaconda\n", "\n", "We recommend installing [the free Anaconda Python distribution](https://www.continuum.io/downloads), which includes IPython, Numpy, Scipy, matplotlib, scikit-learn, NLTK, and many other useful packages. This is not required, but it's an easy way to get all these packages installed. Unless you're very comfortable with Python package management and like installing things, this is the option for you!\n", "\n", "Please be sure that you download the __Python 3__ version, which currently installs Python 3.6. Although our code is largely compatible with Python 2, __we're not supporting Python 2__.\n", "\n", "One you have Anaconda installed, it makes sense to create a virtual environment for the course. In a terminal, run\n", "\n", "```conda create -n nlu python=3.6 anaconda```\n", "\n", "to create an environment called `nlu`.\n", "\n", "Then, to enter the environment, run\n", "\n", "```source activate nlu```\n", "\n", "To leave it, you can just close the window, or run\n", "\n", "```source deactivate nlu```\n", "\n", "[This page](https://conda.io/docs/user-guide/tasks/manage-environments.html) has more detailed instructions on managing virtual environments with Anaconda." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## The course Github repository\n", "\n", "The core materials for the course are on Github:\n", "\n", "https://github.com/cgpotts/cs224u\n", "\n", "We'll be working in this repository a lot, and it will receive updates throughout the quarter, as we add new materials and correct bugs.\n", "\n", "If you're new to git and Github, we recommend using [Github's Desktop Apps](https://desktop.github.com). Then you just have to clone our repository and sync your local copy with the official one when there are updates." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Additional installations\n", "\n", "Be sure to do these additional installations from __inside your virtual environment__ for the course!\n", "\n", "### Installing the package requirements\n", "\n", "Just run\n", "\n", "```pip install -r requirements.txt```\n", "\n", "from inside the course directory to install the core additional packages. \n", "\n", "People who aren't using Anaconda should edit `requirements.txt` so that it installs all the prerequisites that come with Anaconda. For Anaconda users, there's no need to edit it or even open it.\n", "\n", "\n", "### TensorFlow\n", "\n", "The TensorFlow library has special installation instructions depending on your computing environment. The instructions are posted in\n", "\n", "https://www.tensorflow.org/install/\n", "\n", "### NLTK data\n", "\n", "Anaconda comes with NLTK but not with its data distribution. To install that, open a Python interpreter and run `import nltk; nltk.download()`. If you decide to download the data to a different directory than the default, then you'll have to set `NLTK_DATA` in your shell profile. (If that doesn't make sense to you, then we recommend choosing the default download directory!)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Jupyter notebooks\n", "\n", "The majority of the materials for this course are Jupyter notebooks, which allow you to work in a browser, mixing code and description. It's a powerful form of [literate programming](https://en.wikipedia.org/wiki/Literate_programming), and increasingly a standard for open science.\n", "\n", "To start a notebook server, navigate to the directory where you want to work and run\n", "\n", "```jupyter notebook --port 5656```\n", "\n", "The port specification is optional. \n", "\n", "This should launch a browser that takes you to a view of the directory you're in. You can then open notebooks for working and create new notebooks.\n", "\n", "A major advantage of working with Anaconda is that you can switch virtual environments from inside a notebook, via the __Kernel__ menu. If this isn't an option for you, then run this command while inside your virtual environment:\n", "\n", "```python -m ipykernel install --user --name nlu --display-name \"nlu\"```\n", "\n", "(If you named your environment something other than `nlu`, then change the `--name` and `--display-name` values.) \n", "\n", "[Additional discussion of Jupyter and kernels.](https://stackoverflow.com/questions/39604271/conda-environments-not-showing-up-in-jupyter-notebook)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## SippyCup\n", "\n", "Our semantic parsing library is [SippyCup](https://github.com/wcmac/sippycup). Clone this repository for local use. We'll help you get set up to use it as part of the semantic parsing unit." ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.6.4" } }, "nbformat": 4, "nbformat_minor": 1 }