makcedward / nlpaug

Data augmentation for NLP
https://makcedward.github.io/
MIT License
4.41k stars 460 forks source link

Add check to fix bug caused by short token lists in word augmenter #314

Open rohit-gupta opened 1 year ago

rohit-gupta commented 1 year ago

_get_aug_range_idxes fails if length of tokens is less than or equal to aug_cnt, which primarily shows up in cases where sequences are too short. fixing this by adding a check