You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,if you get the aug_cnt is 1, then when you call "self.sample", you will get the "ValueError: Sample larger than population or is negative"
def _get_aug_range_idxes(self, tokens):
aug_cnt = self.generate_aug_cnt(len(tokens))
print("aug_cnt:", aug_cnt)
direction = self.sample([-1, 1], 1)[0]
if direction > 0:
# right
word_idxes = [i for i, _ in enumerate(tokens[:-aug_cnt+1])]
else:
# left
word_idxes = [i for i, _ in enumerate(tokens[aug_cnt-1:])]
start_aug_idx = self.sample(word_idxes, 1)[0]
aug_idxes = [start_aug_idx + _*direction for _ in range(aug_cnt)]
return aug_idxes
The text was updated successfully, but these errors were encountered:
Hi,if you get the aug_cnt is 1, then when you call "self.sample", you will get the "ValueError: Sample larger than population or is negative"
The text was updated successfully, but these errors were encountered: