--- id: nlpaug version: "1.1.11" license: MIT license_treatment: permissive maintenance: active --- # nlpaug — Natural language processing augmentation library for deep neural networks License: permissive · Maintenance: active · Downloads: 189.3K/mo ## 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 above — 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 pip install nlpaug uv add nlpaug 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_current - Install friction: low - Maintenance: active - Downloads: 189.3K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags nlp data augmentation, text augmentation library, synthetic training data generation, audio augmentation, adversarial text generation, machine learning data expansion, nlp preprocessing augmentation, data-augmentation, nlp, audio-processing [View on SkillFed](https://skillfed.io/packages/nlpaug) · [View on PyPI](https://pypi.org/project/nlpaug/)