PyText is a deep-learning based NLP modeling framework built on PyTorch. PyText addresses the often-conflicting requirements between enabling rapid experimentation for NLP models and serving these models at scale. It achieves this by providing simple and extensible interfaces and abstractions for the different model components, and by using PyTorch to export models for inference via the optimized Caffe2 execution engine. PyText is used at Facebook to iterate quickly on new modeling ideas and then seamlessly deploy them at scale.

Production-ready state-of-the-art NLP models

PyText allows researchers and engineers to use efficient distributed training to train custom models for different NLP tasks on their own datasets and then export them to Caffe2 via ONNX. Examples of the tasks that are currently supported in PyText include:

  • Document classification

  • Sequence tagging

  • Semantic parsing

  • Multi-task learning

Easily extensible to support new models & tasks

PyText is designed and built to be easily extensible to support new tasks and use-cases, and allows the reuse of prebuilt components from other tasks.

Get Started


  • Install PyText pip install pytext-nlp

  • 2

  • Learn how to write a model in PyText, train and evaluate it against a benchmark and deploy the model at scale in AWS

  • 3

  • Follow an in-depth tutorial on how to create a new task and model in PyText

  • 4

  • Review the PyText documentation to familiarize yourself with its different components and abstractions

  • More Tools


    PyTorch is an open source deep learning framework built to be flexible and modular for research, with the stability and support needed for production deployment. It enables fast, flexible experimentation through a tape-based autograd system designed for immediate and python-like execution.


    ONNX is an open format for deep learning models, allowing AI developers to easily move between state-of-the-art tools.

    Join Us

    Tackle the world's most complex technology challenges

    Join Our Team

    Latest News

    Visit the AI Blog for updates on recent publications, new tools, and more.

    Visit Blog