Text Classifjcation using PyTorch Jindich Libovick November 28, - - PowerPoint PPT Presentation

text classifjcation using pytorch
SMART_READER_LITE
LIVE PREVIEW

Text Classifjcation using PyTorch Jindich Libovick November 28, - - PowerPoint PPT Presentation

Text Classifjcation using PyTorch Jindich Libovick November 28, 2018 B4M36NLP Introduction to Natural Language Processing Charles University Faculty of Mathematics and Physics Institute of Formal and Applied Linguistics unless otherwise


slide-1
SLIDE 1

Text Classifjcation using PyTorch

Jindřich Libovický

November 28, 2018

B4M36NLP Introduction to Natural Language Processing

Charles University Faculty of Mathematics and Physics Institute of Formal and Applied Linguistics unless otherwise stated

slide-2
SLIDE 2

Sentiment Classifjcation Given a short text, decide whether it makes a positive, negative or neural statement.

Text Classifjcation using PyTorch

1/4

slide-3
SLIDE 3

Prepare Python Environment

  • create a new environment

virtualenv -p python3 env

  • activate the environment

source env/bin/activate

  • install PyTorch, Spacy and Jupyter

pip3 install torch torchvision torchtext pip3 install jupyter pip3 install spacy python -m spacy download en

Text Classifjcation using PyTorch

2/4

slide-4
SLIDE 4

Alternatively using Anaconda

  • download and install Anaconda

wget https://repo.continuum.io/archive/Anaconda2-5.3.1-Linux-x86_64.sh bash Anaconda3-4.2.0-Linux-x86_64.sh export PATH=$PATH:$HOME/anaconda3/bin

  • create a new environment

conda create -n pytorch python=3.6 anaconda

  • activate the environment

source activate pytorch

  • install PyTorch, Spacy and Jupyter

pip3 install torch torchvision torchtext pip3 install jupyter pip3 install spacy python -m spacy download en

Text Classifjcation using PyTorch

3/4

slide-5
SLIDE 5

Download the Lab Notebook

  • download the notebook

wget http://ufallab.ms.mff.cuni.cz/l̃ibovicky/ctu_lab_1.ipynb)

  • run jupyter in the same directory

jupyter notebook

Text Classifjcation using PyTorch

4/4