Permalink
Browse files

Refine doc index page (#102)

Summary:
Pull Request resolved: #102

Update install from pip
Add instructions of how to get demo config and test files

Reviewed By: m3rlin45

Differential Revision: D13462843

fbshipit-source-id: ab1a16586e0961d833f47aef6059a4e0b1dcbc20
  • Loading branch information...
seayoung1112 authored and facebook-github-bot committed Dec 14, 2018
1 parent 505b447 commit 4f3042ca087d0b630e8b169d5e20af8065bc57b8
Showing with 22 additions and 16 deletions.
  1. +1 −0 .gitignore
  2. +4 −4 README.md
  3. +1 −1 activation_venv
  4. +1 −1 activation_venv.bat
  5. +3 −0 pytext/docs/source/index.rst
  6. +12 −10 pytext/docs/source/installation.rst
@@ -20,6 +20,7 @@ eggs/
# Environments
.env
.venv
pytext_venv/
env/
venv/
ENV/
@@ -26,12 +26,12 @@ PyText is a deep-learning based NLP modeling framework built on PyTorch. PyText
We recommend using a virtualenv:

```
$ python3 -m venv myvenv
$ source myvenv/bin/activate
(myvenv) $ pip install pytext-nlp
$ python3 -m venv pytext_venv
$ source pytext_venv/bin/activate
(pytext_venv) $ pip install pytext-nlp
```

Detailed instructions can be found in our [Documentation](https://pytext-pytext.readthedocs-hosted.com/en/latest/installation.html). If you encounter issues with missing dependencies during installation, please refer to [OS Dependencies](https://pytext-pytext.readthedocs-hosted.com/en/latest/installation.html#os-dependencies).
Detailed instructions and more installation options can be found in our [Documentation](https://pytext-pytext.readthedocs-hosted.com/en/latest/installation.html). If you encounter issues with missing dependencies during installation, please refer to [OS Dependencies](https://pytext-pytext.readthedocs-hosted.com/en/latest/installation.html#os-dependencies).

# Train your first text classifier

@@ -1,5 +1,5 @@
#!/usr/bin/env bash
VENV_NAME=${1:-venv}
VENV_NAME=${1:-pytext_venv}

if [ ! -d "$VENV_NAME" ]
then
@@ -2,7 +2,7 @@
::Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
::Use venv name if passed, otherwise default
IF "%1"=="" (
SET "_PYTEXT_ENV_NAME_=venv"
SET "_PYTEXT_ENV_NAME_=pytext_venv"
) ELSE (
SET "_PYTEXT_ENV_NAME_=%1"
)
@@ -44,6 +44,9 @@ After that, you can explore more options of builtin models and training methods

If you want to use PyText as a library and build your own models, please check the tutorial in **Extending PyText**

.. note::
All the demo configs and test data for the tutorials can be found in source code. You can either install PyText from source or download the files manually from GitHub.

.. toctree::
:maxdepth: 1
:caption: Getting Started
@@ -14,14 +14,16 @@ The easiest way to get started on most systems is to create a `virtualenv`

.. code-block:: console

$ python3 -m virtualenv venv
$ source pytext/bin/activate
(venv) $ pip install pytext-nlp
$ python3 -m venv pytext_venv
$ source pytext_venv/bin/activate
(pytext_venv) $ pip install pytext-nlp

This will install a version of PyTorch depending on your system. See `PyTorch <https://pytorch.org>`_ for more information. If you are using MacOS or Windows, this likely will not include GPU support by default; if you are using Linux, you should automatically get a version of PyTorch compatible with CUDA 9.0.

If you need a different version of PyTorch, follow the instructions on the `PyTorch website <https://pytorch.org>`_ to install the appropriate version of PyTorch before installing PyText



OS Dependencies
---------------

@@ -66,18 +68,18 @@ Install From Source
$ git clone git@github.com:facebookresearch/pytext.git
$ cd pytext
$ source activation_venv
(venv) $ pip install torch # go to https://pytorch.org for platform specific installs
(venv) $ ./install_deps
(pytext_venv) $ pip install torch # go to https://pytorch.org for platform specific installs
(pytext_venv) $ ./install_deps

Once that is installed, you can run the unit tests. We recommend using pytest as a runner.

.. code-block:: console

(venv) $ pip install -U pytest
(venv) $ pytest
(pytext_venv) $ pip install -U pytest
(pytext_venv) $ pytest
# If you want to measure test coverage, we recommend `pytest-cov`
(venv) $ pip install -U pytest-cov
(venv) $ pytest --cov=pytext
(pytext_venv) $ pip install -U pytest-cov
(pytext_venv) $ pytest --cov=pytext

To resume development in an already checked-out repo:

@@ -90,7 +92,7 @@ To exit the virtual environment:

.. code-block:: console

(venv) $ deactivate
(pytext_venv) $ deactivate


Cloud VM Setup

0 comments on commit 4f3042c

Please sign in to comment.