Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix errors in SETUP.md #44

Open
wants to merge 17 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
assets/images/
**/data/*
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
Expand Down
37 changes: 22 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,41 +1,48 @@
# Natural Language Processing with PyTorch

_Build Intelligent Language Applications Using Deep Learning_
<br>By Delip Rao and Brian McMahan
By Delip Rao and Brian McMahan

Welcome. This repository is a fork of the [original repository](https://github.com/delip/PyTorchNLPBook) for the book _Natural Language Processing with PyTorch: Build Intelligent Language Applications Using Deep Learning_. (2019). ISBN: 9781491978221. Available on [Amazon](https://www.amazon.com/Natural-Language-Processing-PyTorch-Applications/dp/1491978236/) and [O'Reilly Media](https://learning.oreilly.com/library/view/natural-language-processing/9781491978221).

This fork addresses the following issues with the original repository.

Welcome. This is a companion repository for the book [Natural Language Processing with PyTorch: Build Intelligent Language Applications Using Deep Learning](https://www.amazon.com/Natural-Language-Processing-PyTorch-Applications/dp/1491978236/).
| Issue | Description | Resolution |
|-------|-------------|------------|
| | | |

## Table of Contents

Table of Contents
=================
---

<!--ts-->
* Get Started!
* [Chapter 1: Introduction](https://github.com/joosthub/PyTorchNLPBook/tree/master/chapters/chapter_1)
* [Chapter 1: Introduction](https://github.com/ciioprof0/PyTorchNLPBook/tree/master/chapters/chapter_1)
* PyTorch Basics
* Chapter 2: A Quick Tour of NLP
* [Chapter 3: Foundational Components of Neural Networks](https://github.com/joosthub/PyTorchNLPBook/tree/master/chapters/chapter_3)
* Chapter 2: [A Quick Tour of NLP](https://github.com/ciioprof0/PyTorchNLPBook/tree/master/chapters/chapter_1)
* In-text examples
* [Chapter 3: Foundational Components of Neural Networks](https://github.com/ciioprof0/PyTorchNLPBook/tree/master/chapters/chapter_3)
* In-text examples
* Diving deep into supervised training
* Classifying sentiment of restaurant reviews using a Perceptron
* [Chapter 4: Feed-forward Networks for NLP](https://github.com/joosthub/PyTorchNLPBook/tree/master/chapters/chapter_4)
* [Chapter 4: Feed-forward Networks for NLP](https://github.com/ciioprof0/PyTorchNLPBook/tree/master/chapters/chapter_4)
* Limitations of the Perceptron
* Introducing Multi-layer Perceptrons (MLPs)
* Introducing Convolutional Neural Networks (CNNs)
* Surname Classification with an MLP
* Surname Classification with a CNN
* [Chapter 5: Embedding Words and Types](https://github.com/joosthub/PyTorchNLPBook/tree/master/chapters/chapter_5)
* [Chapter 5: Embedding Words and Types](https://github.com/ciioprof0/PyTorchNLPBook/tree/master/chapters/chapter_5)
* Using Pretrained Embeddings
* Learning Continous Bag-of-words Embeddings (CBOW)
* Learning Continuous Bag-of-words Embeddings (CBOW)
* Transfer Learning using Pre-trained Embeddings
* [Chapter 6: Sequence Modeling for NLP](https://github.com/joosthub/PyTorchNLPBook/tree/master/chapters/chapter_6)
* [Chapter 6: Sequence Modeling for NLP](https://github.com/ciioprof0/PyTorchNLPBook/tree/master/chapters/chapter_6)
* A sequence representation for Surnames
* [Chapter 7: Intermediate Sequence Modeling for NLP](https://github.com/joosthub/PyTorchNLPBook/tree/master/chapters/chapter_7)
* [Chapter 7: Intermediate Sequence Modeling for NLP](https://github.com/ciioprof0/PyTorchNLPBook/tree/master/chapters/chapter_7)
* Generating novel surnames from sequence representations
* Uncondition generation
* Unconditioned generation
* Conditioned generation
* [Chapter 8: Advanced Sequence Modeling for NLP](https://github.com/joosthub/PyTorchNLPBook/tree/master/chapters/chapter_8)
* Understanding PackedSequences
* [Chapter 8: Advanced Sequence Modeling for NLP](https://github.com/ciioprof0/PyTorchNLPBook/tree/master/chapters/chapter_8)
* Understanding PackedSequences
* Sequence to Sequence Learning
* Attention
* Neural Machine Translation
Expand Down
74 changes: 30 additions & 44 deletions SETUP.md
Original file line number Diff line number Diff line change
@@ -1,71 +1,57 @@
# Setup Instructions

The recommended setup is described below. Modifications to this setup will be called out as appropriate.
The recommended setup is described below. Modifications to this setup will be called out as appropriate.

## Clone the Repository

## Conda Environment
Clone the [repository](https://github.com/ciioprof0/PyTorchNLPBook) from GitHub using one of the options below:

It is highly recommended that a conda environment is used to house your PyTorch installation. This has the benefit of insulating against vesion differences. Alternatives to using conda for installation can be found on [pytorch.org](https://pytorch.org).
- Option A. The web URL:

### Create the environment

```
# Create the environment
conda create --name nlpbook
source activate nlpbook
```{bash}
git clone https://github.com/ciioprof0/PyTorchNLPBook.git
```

### Install PyTorch
- Option B. The SSH URL:

Note, this installs the GPU versions as of January, 2019. If this command changes in the future, this README will be updated accordingly. If it is not, please file an issue.

```
conda install pytorch torchvision -c pytorch
```{bash}
git clone [email protected]:ciioprof0/PyTorchNLPBook.git
```

If you need the CPU versions, want to use pip install of conda, or a host of other configuration variations, please consult the website. They have done a great job of making it easy to retrieve the correct install command.

### Download the Repositroy

You can download the repository from [this URL](https://nlproc.info/PyTorchNLPBook/repo/) using git or downloading the repository as a zip file. As of January, 2019, this URL redirects to https://github.com/joosthub/PyTorchNLPBook and you can use the following commands to clone the repository:
- Option C. The GitHub CLI:

```
git clone [email protected]:joosthub/PyTorchNLPBook.git
```{bash}
gh repo clone ciioprof0/PyTorchNLPBook
```

Or
## Create the local environment

```
git clone https://github.com/joosthub/PyTorchNLPBook.git
```
Install the Conda Environment

### Install the remaining packages with the requirements file
It is highly recommended that a conda environment is used to house your PyTorch installation. This has the benefit of insulating against version differences. See [Installing conda](https://docs.conda.io/projects/conda/en/latest/user-guide/install/index.html) for instructions on how to install conda pn your system. The [Miniconda](https://docs.anaconda.com/miniconda/) installer is sufficient for this purpose.

Inside the repository is a requirements file which can be used to install the remaining packages.
Alternatives to using conda for installation can be found on [pytorch.org](https://pytorch.org).

```
cd PyTorchNLPBook
pip install -r requirements.txt
```
### Create the conda environment

### Installing the jupyter kernel
When you have conda installed, you can create an environment with the following command from the project root directory:

```
python -m ipykernel install --user --name nlpbook
Step 1. Create the environment from the `environment.yml` file:

```{bash}
conda env create -f setup/conda/environment.yml --no-default-packages
```

### Download the data
Step 2. Activate the environment:

```
cd data
./get-all-data.sh
```{bash}
source activate nlpbook
```

Note: GloVe is not bundled in our data downloader. See `data/README.md` for more information.
Step 3. Download the data:

### Run the notebook server
_Note_. The script below has not yet been updated to download the missing data files. Please see the `data/README.md` for manual installation instructions.

```
# run from the top level. if running commands in order, will need to `cd ..`
jupyter notebook
```
```{bash}
bash src/get-all-data.sh
```
Loading