skillfed

nlpaug

Natural language processing augmentation library for deep neural networks

nlpaug v1.1.11 189.3K downloads/30d#9,930 on PyPI4,667
Permissive license MIT Active released

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 nlpaug

uv

uv add nlpaug

poetry

poetry add nlpaug

Installing 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

nlp data augmentationtext augmentation librarysynthetic training data generationaudio augmentationadversarial text generationmachine learning data expansionnlp preprocessing augmentation
data-augmentationnlpaudio-processing

More Artificial Intelligence packages