pytorch/text is a Python project with 3.6k stars in the AI Tools space. Models, data loaders and abstractions for language processing, powered by PyTorch
Snapshot summary built from the project's own GitHub metadata — there's no written TopGit review yet. The page will update automatically when a full review is published.
WHY NO REVIEW YET
TopGit writes full reviews for the most-starred, most-requested repositories. This page is a snapshot until then — see the READ ME tab for the original README in full.
torchtext.vocab <https://github.com/pytorch/text/tree/main/torchtext/vocab>_: Vocab and Vectors related classes and factory functions
examples <https://github.com/pytorch/text/tree/main/examples>_: Example NLP workflows with PyTorch and torchtext library.
Installation
We recommend Anaconda as a Python package management system. Please refer to pytorch.org <https://pytorch.org/>_ for the details of PyTorch installation. The following are the corresponding torchtext versions and supported Python versions.
Alternatively, you might want to use the Moses <http://www.statmt.org/moses/>_ tokenizer port in SacreMoses <https://github.com/alvations/sacremoses>_ (split from NLTK <http://nltk.org/>_). You have to install SacreMoses::
pip install sacremoses
For torchtext 0.5 and below, sentencepiece::
conda install -c powerai sentencepiece
Building from source
To build torchtext from source, you need git, CMake and C++11 compiler such as g++.::
git clone https://github.com/pytorch/text torchtext
cd torchtext
git submodule update --init --recursive
# Linux
python setup.py clean install
# OSX
CC=clang CXX=clang++ python setup.py clean install
# or ``python setup.py develop`` if you are making modifications.
Note
When building from source, make sure that you have the same C++ compiler as the one used to build PyTorch. A simple way is to build PyTorch from source and use the same environment to build torchtext.
If you are using the nightly build of PyTorch, checkout the environment it was built with conda (here) <https://github.com/pytorch/builder/tree/main/conda>_ and pip (here) <https://github.com/pytorch/builder/tree/main/manywheel>_.
Additionally, datasets in torchtext are implemented using the torchdata library. Please take a look at the
installation instructions <https://github.com/pytorch/data#installation>_ to download the latest nightlies or install from source.
Documentation
Find the documentation here <https://pytorch.org/text/>_.
Datasets
The datasets module currently contains:
Language modeling: WikiText2, WikiText103, PennTreebank, EnWik9
To get started with torchtext, users may refer to the following tutorial available on PyTorch website.
SST-2 binary text classification using XLM-R pre-trained model <https://pytorch.org/text/stable/tutorials/sst2_classification_non_distributed.html>_
Text classification with AG_NEWS dataset <https://pytorch.org/tutorials/beginner/text_sentiment_ngrams_tutorial.html>_
Translation trained with Multi30k dataset using transformers and torchtext <https://pytorch.org/tutorials/beginner/translation_transformer.html>_
Language modeling using transforms and torchtext <https://pytorch.org/tutorials/beginner/transformer_tutorial.html>_
Disclaimer on Datasets
This is a utility library that downloads and prepares public datasets. We do not host or distribute these datasets, vouch for their quality or fairness, or claim that you have license to use the dataset. It is your responsibility to determine whether you have permission to use the dataset under the dataset's license.
If you're a dataset owner and wish to update any part of it (description, citation, etc.), or do not want your dataset to be included in this library, please get in touch through a GitHub issue. Thanks for your contribution to the ML community!
The most recent commit recorded on pytorch/text was 11 months ago, based on the GitHub push timestamp. The repository has 807 forks — one of the better signals of community interest.
Is pytorch/text open source?
Yes — pytorch/text ships under the BSD-3-Clause license, which makes its source code freely readable (and, depending on license terms, forkable and reusable). Source: github.com/pytorch/text.
What license does pytorch/text use?
pytorch/text is released under the BSD-3-Clause license. Always verify the LICENSE file directly on GitHub for the authoritative terms — license strings can be edited out of sync with a project's actual stance.
What topics is pytorch/text associated with?
GitHub's repository topics for pytorch/text: "data-loader", "dataset", "deep-learning", "models", "nlp", "pytorch". TopGit's editorial category is AI Tools.
Where can I see pytorch/text in action?
The project maintains a homepage at https://pytorch.org/text. The README tab on this page also usually contains screenshots and a quickstart.
Where do I read more about pytorch/text?
This TopGit page is a snapshot — the READ ME tab shows the project's own README content (links stripped, images preserved). The GitHub repository at github.com/pytorch/text is the definitive source.
Read full README in the tab above.
Want a second opinion on text?
Ask an AI that can read this page — one click and you get its take on text.