nlpaug
Natural language processing augmentation library for deep neural networks
What it is and what it does
nlpaug is a Python library for generating synthetic variations of text and audio data to expand training datasets without manual effort. It provides augmenters—individual transformation operations like synonym substitution, keyboard-error simulation, or audio pitch adjustment—and flows to chain multiple augmenters together. The library integrates with standard ML frameworks (scikit-learn, PyTorch, TensorFlow) and supports textual augmentation at character, word, and sentence levels, plus audio and spectrogram transformations.
The core use case is improving model generalization and robustness by creating diverse training examples from existing data. Some augmenters rely on external language models (BERT, GPT-2, word embeddings) or linguistic resources (WordNet), which are optional dependencies. The library is lightweight and designed to integrate into existing ML pipelines with minimal setup.
Use it for:
- Expand small labeled datasets by generating synthetic text variations to train more robust NLP models without manual annotation.
- Simulate adversarial text perturbations (typos, OCR errors, keyboard mistakes) to test model resilience to real-world input noise.
- Augment audio training data by applying pitch, speed, loudness, and noise transformations to improve speech recognition or audio classification.
- Create multilingual training examples through back-translation or contextual word embeddings to improve cross-lingual model performance.
- Build data augmentation pipelines that apply multiple transformations sequentially or probabilistically to generate diverse training batches.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
nlpaug generates synthetic augmented text and audio data for machine learning projects by applying transformations like word substitution, insertion, deletion, and audio modifications to improve model robustness and performance.
Yes. nlpaug is actively maintained, has no known vulnerabilities, installs with low friction, and provides a practical toolkit for a common ML workflow. Install it if you need to augment text or audio data for training; skip it if your training pipeline already has dedicated augmentation logic or if you work exclusively with image data.
Install
nlpaug on PyPI
pip
pip install nlpauguv
uv add nlpaugpoetry
poetry add nlpaugInstalling nlpaug
Before you install
Low friction installation with a pure Python wheel and four common runtime dependencies (numpy, pandas, requests, gdown). The package is actively maintained with recent commits and no known vulnerabilities.
License in practice
MIT license permits unrestricted use, modification, and distribution in commercial and private projects with minimal obligations.
Quickstart
pip install nlpaug numpy pandas requests gdown
import nlpaug.augmenter.word as naw
aug = naw.SynonymAug(aug_src='wordnet')
augmented_text = aug.augment('The quick brown fox jumps')
Some augmenters (ContextualWordEmbsAug, BackTranslationAug, LambadaAug) require optional dependencies like torch, transformers, or nltk; basic augmenters work with the core install.
Verify before relying
- Whether pre-trained models (word2vec, GloVe, fasttext) are bundled or must be downloaded separately at runtime.
- Performance characteristics when augmenting large datasets or applying multiple augmenters in sequence.
- Compatibility with specific versions of optional dependencies (torch, transformers, nltk, gensim) beyond what the description lists.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.7) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 4 — numpy, pandas, requests, gdown |
| Maintenance | actively maintained — 1,499 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 189,327/month — #9,930 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: nlpaug-1.1.11-py3-none-any.whl
Keywords: deep learning, neural network, machine learning, nlp, natural language processing, text, audio, spectrogram, augmentation, adversarial attack, ai, ml
Tags
More Artificial Intelligence packages
LiteLLM provides a unified Python interface to…
permissive · top 100 on PyPI
huggingface-hubClient library and CLI tool for downloading,…
permissive · top 100 on PyPI
langchainLangChain provides a framework for building…
permissive · top 1,000 on PyPI
hf-xethf-xet provides chunk-based deduplication and…
permissive · top 1,000 on PyPI
tokenizersTokenizers converts raw text into token…
permissive · top 1,000 on PyPI
transformersTransformers provides a unified framework for…
permissive · top 1,000 on PyPI
audiomentationsAudiomentations applies randomized audio…
permissive · top 15,000 on PyPI
torch-audiomentationsProvides PyTorch-native audio data augmentation…
permissive · top 5,000 on PyPI
torchaudioProvides PyTorch-based audio processing,…
permissive · top 5,000 on PyPI
nvidia-riva-clientClient library for NVIDIA Riva, a…
permissive · top 15,000 on PyPI
ttachWraps PyTorch models to apply test-time…
permissive · top 15,000 on PyPI
livekit-plugins-inworldIntegrates Inworld's text-to-speech and…
permissive · top 15,000 on PyPI
descript-audiotoolsProvides object-oriented audio signal handling…
permissive · top 15,000 on PyPI
openwakewordopenWakeWord detects wake words and phrases in…
permissive · top 15,000 on PyPI
flairFlair is a PyTorch-based NLP framework that…
permissive · top 15,000 on PyPI
imgaugAugments images and related data (heatmaps,…
permissive · top 5,000 on PyPI