nlpaug icon indicating copy to clipboard operation
nlpaug copied to clipboard

Is it possible to use character aug with all the action (substitute, inset, delete, swap at the same time?)

Open keloemma opened this issue 3 years ago • 1 comments

keloemma avatar Feb 14 '22 12:02 keloemma

Technically, it is doable. However, why do you want to generate this kind of synthetic data? Generating meaningful synthetic data helps to improve model performance.

You may use Flow and add all of the actions. Here is the sample code:

import nlpaug.augmenter.char as nac

aug = naf.Sequential([
    nac.RandomCharAug(action="insert"),
    nac.RandomCharAug(action="delete"),
    # ...
])

text = 'The quick brown fox jumps over the lazy dog'
aug.augment(text)

makcedward avatar Apr 03 '22 05:04 makcedward