ulf1 / augtxt

yet another text augmentation python package
Apache License 2.0
2 stars 0 forks source link

avoid empty indicies #57

Closed ulf1 closed 2 years ago

ulf1 commented 2 years ago

https://github.com/ulf1/augtxt/blob/c03c7c2ed6ce83497cb5c0dcebef38e88ea31209/augtxt/punct.py#L35

augtxt/punct.py", line 35, in merge_words
    indicies = np.flip(np.sort(np.random.choice(indicies, size=num_aug)))
  File "mtrand.pyx", line 909, in numpy.random.mtrand.RandomState.choice
ValueError: 'a' cannot be empty unless no samples are taken