Skip to content

Commit

Permalink
Merge pull request #252 from rogier-stegeman/fix-empty-list
Browse files Browse the repository at this point in the history
fix(augmenter/word/random.py): Empty list error
  • Loading branch information
makcedward authored Nov 20, 2021
2 parents 30b2b0b + 879225a commit e26492a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion nlpaug/augmenter/word/random.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def __init__(self, action=Action.DELETE, name='RandomWord_Aug', aug_min=1, aug_m
tokenizer=tokenizer, reverse_tokenizer=reverse_tokenizer, device='cpu', verbose=verbose,
stopwords_regex=stopwords_regex, include_detail=False)

self.target_words = ['_'] if target_words is None else target_words
self.target_words = target_words or ['_']

# https://arxiv.org/pdf/1711.02173.pdf, https://arxiv.org/pdf/1809.02079.pdf, https://arxiv.org/pdf/1903.09460.pdf
def swap(self, data):
Expand Down

0 comments on commit e26492a

Please sign in to comment.