Skip to content

Initial release, 16-07-2019

Compare
Choose a tag to compare
@JosephSefara JosephSefara released this 16 Jul 07:20
· 57 commits to master since this release

TextAugment is a Python 3 library for augmenting text for natural language processing applications. TextAugment stands on the giant shoulders of NLTK, Gensim, and TextBlob and plays nicely with them.

Requirements

  • Python 3
    The following software packages are dependencies and will be installed automatically.
$ pip install numpy nltk gensim textblob googletrans 

The following code downloads wordnet, tokenizer, and part-of-speech tagger model.

nltk.download('wordnet')
nltk.download('punkt')
nltk.download('averaged_perceptron_tagger')

Install from pip [Recommended]

$ pip install textaugment

How to use

>>> from textaugment import Word2vec
>>> t = Word2vec(model='path/to/gensim/model'or 'gensim model itself')
>>> t.augment('The stories are good')
The films are good

Citation

@article{marivate2019improving,
  title={Improving short text classification through global augmentation methods},
  author={Marivate, Vukosi and Sefara, Tshephisho},
  journal={arXiv preprint arXiv:1907.03752},
  year={2019}
}

Built with ❤ on Python