Giter VIP home page Giter VIP logo

notebooks's Introduction

Transformers Notebooks

This repository contains the example code from our O'Reilly book Natural Language Processing with Transformers:

book-cover

Getting started

You can run these notebooks on cloud platforms like Google Colab or your local machine. Note that most chapters require a GPU to run in a reasonable amount of time, so we recommend one of the cloud platforms as they come pre-installed with CUDA.

Running on a cloud platform

To run these notebooks on a cloud platform, just click on one of the badges in the table below:

Chapter Colab Kaggle Gradient Studio Lab
Introduction Open In Colab Kaggle Gradient Open In SageMaker Studio Lab
Text Classification Open In Colab Kaggle Gradient Open In SageMaker Studio Lab
Transformer Anatomy Open In Colab Kaggle Gradient Open In SageMaker Studio Lab
Multilingual Named Entity Recognition Open In Colab Kaggle Gradient Open In SageMaker Studio Lab
Text Generation Open In Colab Kaggle Gradient Open In SageMaker Studio Lab
Summarization Open In Colab Kaggle Gradient Open In SageMaker Studio Lab
Question Answering Open In Colab Kaggle Gradient Open In SageMaker Studio Lab
Making Transformers Efficient in Production Open In Colab Kaggle Gradient Open In SageMaker Studio Lab
Dealing with Few to No Labels Open In Colab Kaggle Gradient Open In SageMaker Studio Lab
Training Transformers from Scratch Open In Colab Kaggle Gradient Open In SageMaker Studio Lab
Future Directions Open In Colab Kaggle Gradient Open In SageMaker Studio Lab

Nowadays, the GPUs on Colab tend to be K80s (which have limited memory), so we recommend using Kaggle, Gradient, or SageMaker Studio Lab. These platforms tend to provide more performant GPUs like P100s, all for free!

Note: some cloud platforms like Kaggle require you to restart the notebook after installing new packages.

Running on your machine

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

Next, run the following command to create a conda virtual environment that contains all the libraries needed to run the notebooks:

$ conda env create -f environment.yml

Chapter 7 (Question Answering) has a special set of dependencies, so to run that chapter you'll need a separate environment:

$ conda env create -f environment-chapter7.yml

Once you've installed the dependencies, you can activate the conda environment and spin up the notebooks as follows:

$ conda activate book # or conda activate book-chapter7
$ jupyter notebook

Citations

If you'd like to cite this book, you can use the following BibTeX entry:

@book{tunstall2022natural,
  title={Natural Language Processing with Transformers: Building Language Applications with Hugging Face},
  author={Tunstall, Lewis and von Werra, Leandro and Wolf, Thomas},
  isbn={1098103246},
  url={https://books.google.ch/books?id=7hhyzgEACAAJ},
  year={2022},
  publisher={O'Reilly Media, Incorporated}
}

notebooks's People

Contributors

carlos-aguayo avatar dependabot[bot] avatar lewtun avatar lvwerra avatar osanseviero avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.