This repository contains some accompanying material to the course I am teaching on Speech and Language Processing in Modern Applications at DeepLearn 2022 at Lulea University of Technology in Sweden. You can find the course description here
In this repo, you will be able to:
- Setup your environment
- Run your first transformer
- Fine-tune your transformer
You can run the notebooks in this repo either in your machine or in a cloud platform with a GPU. I recommend Google Colab as most work with large NLP models require a GPU to run in a reasonable amount of time and these cloud services come pre-installed with CUDA.
Notebook | Colab |
---|---|
Glove Embeddings | |
Text classifier |
To run the notebooks on your own machine, first clone the repository and navigate to it:
$ git clone https://github.com/nlp-with-transformers/notebooks.git
$ cd notebooks
One of the best package and dependency managers in python is conda
. Install Miniconda
with:
# Mac (Intel based)
$ wget https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-x86_64.sh
$ bash Miniconda3-latest-MacOSX-x86_64.sh
# Linux
$ wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
$ bash Miniconda3-latest-Linux-x86_64.sh
Create the environment with:
# CPU-based
$ conda env create -f environment-cpu.yml
# GPU-based
$ conda env create -f environment-gpu.yml
You should see that your environment is active in your shell. For ex. (deeplearn-cpu) othmane@My-MacBook-Pro ~ %
Once you've installed the dependencies, you can activate the conda environment and spin up the notebooks as follows:
# CPU-based
$ conda activate deeplearn-cpu
# GPU-based
$ conda activate deeplearn-gpu
Launch jupyterhub
:
$ jupyter lab