NoiseMix is made for exactly this. (Full disclosure: I am advisor to the project.)
It applies simple transformations to rows of text data while preserving labels.
The word-level perturbations are: add_letter
, repeat_letter
,
remove_letter
, lowercase
, remove_punct
, word_swap
,
char_swap
, flip_letters
and typo_qwerty
. The sentence-level
perturbations are: remove_space
and flip_words
It is still under construction, but the initial benchmarks included the StackExchange question tagging task from the fastText supervised tutorial with about 10000 training rows with 734 labels - similar to your task.
To avoid false precision and a massive table and the nuances of precision and recall for multi-label, I will not quote exact results, but the improvements across tasks are significant, between 3% and 10%, reducing errors by one tenth to almost one half. The exact results will depend on the parameter values you set in config.json.
Noisification is not as effective when the dataset is already large and noisy, and of course training time increases are not a joke at scale. The optimist way to spin diminishing returns is that noisification tends to be more effective on tasks where the dataset size is very small and the initial baseline results very bad.
To get the NoiseMix code and required libs:
git clone https://github.com/noisemix/noisemix.git
cd noisemix
pip install -r requirements.txt
If you have data in fastText format , then you can simply run:
python noisemix.py train.ft.txt -format fastText
This will output a file train.ft.txt.nmx
in the same format but with one generated line from every original line, doubling the dataset size.
To increase that, add -versions 2
to get two new lines from every original. But the intuition from the initial results is that it is just as effective to increase the perturbations per line (MAX_PERTURBATION
in the config) as to increase the number of lines. The lines look totally butchered, but it works, and trains faster.
The only supported format is fastText (labels prefixed with __label__
), you can add other formats in formats.py. You can add data for locales besides English / QWERTY in data.py. Python 3.
You can also try using pre-trained vectors. Conceptually realistic data augmentation is not too different, NoiseMix is just a bit more tuned for user-generated data, whereas fastText Wikipedia pre-trained vectors are a model of the standard formal language.