Textmentations

Latest version: v1.4.0

Safety actively analyzes 702684 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 2 of 3

1.2.3

Changes
- Converted upper bound of albumentations' version to 1.4.14.
- Added more tests.

Deprecations

always_apply
- `always_apply` is deprecated for compatibility with albumentations. Use `p=1` instead.

Bugfixes

- Bugfix in `RandomDeletionSentence`. Bug cases are below.
1. min_sentence = 0 when ignore_first is True, the result is -1.
2. num_original_sentences * min_sentence <= 1 when ignore_first is True, the result is a negative number.

1.2.2

Highlights

python
from textmentations.corpora.corpora import get_stopwords, get_wordnet

stopwords = get_stopwords()
wordnet = get_wordnet()


- You can use stopwords and wordnet!

Changes

- Converted upper bound of albumentations' version to 1.4.8.
- Disabled ReplayCompose because of compatibility.
- Added way to get stopwords and wordnet.

1.2.1

Changes

- Now `add_targets` method in TextTransform raise AttributeError. Do not use it.
- Added more tests for serialization.
- Bugfix in `TextTransform`. Now `__version__` in `to_dict` method's output indicates current version of textmentatons.

1.2.0

Breaking changes
- Updated the minimum required Python version to 3.8.
- Renamed `insert_punctutaions` function to `insert_punctuation`.

Composition
- Switch from albumentations to textmentations for composition.

Old way:
python
import albumentations as A

A.Compose([...])
A.OneOf([...])
...


New way:
python
import textmentations as T

T.Compose([...])
T.OneOf([...])
...


Deprecations

AEDA
Old way:
python
AEDA(
insertion_prob_limit=(0.1, 0.3),
punctuations=(",", "."),
)


New way:
python
AEDA(
insertion_prob_range=(0.1, 0.3),
punctuation=(",", "."),
)


RandomDeletion
Old way:
python
RandomDeletion(min_words_each_sentence=1)

New way:
python
RandomDeletion(min_words_per_sentence=1)


Minor changes
- Speedup in `RandomInsertion` when processing long text.
- If punctuation parameter in AEDA is an empty tuple, now raise TypeError.
- The `insert_synonym` function no longer inserts a synonym at the first index.
- Fixed `delete_*` functions remove each word with equal probability, regardless of word order.

1.1.1

Changes:
- Updated the upper version bound for the albumentations package in requirements.txt to 1.4.3 to resolve compatibility issues with the latest version.

1.1.0

Breaking changes
- Renamed util functions (split_\*, join_\*)
- Added "_" at the beginning of functions (to make private) in `functional.py` except for functions used `transforms.py`

New augmentations
- [BackTranslation](https://github.com/Jaesu26/textmentations/blob/v1.1.0/textmentations/augmentations/transforms.py#L73) - Back-translates the input text by translating it to the target language and then back to the original.

Minor changes
- Added more tests
- Speed up (Use list comprehension: `RandomInsertion`, `AEDA`)
- Applied isort, black

Page 2 of 3

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.