Closed amitkml closed 3 years ago
It can be reproduced by the following codes. The root cause is at least one of the elements does not include text. Will fix it in next release. Meanwhile, you may check input to prevent this exception
aug = naw.RandomWordAug(action='crop',aug_p=0.5, aug_min=0)
aug.augment([''])
Hi,
NLP Augmentation with crop is failing with error Sample larger than population or is negative.
aug = naw.RandomWordAug(action='crop',aug_p=0.5, aug_min=0) train_st_data_crop_aug['sentence_aug'] = train_st_data_crop_aug.apply(lambda x: aug.augment(x['sentence']),axis=1) ## Delete a set of contunous word will be removed randomly¶
ValueError Traceback (most recent call last)