Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keyboard Augmenter error with special characters #114

Closed
apolanco115 opened this issue Mar 5, 2020 · 0 comments
Closed

Keyboard Augmenter error with special characters #114

apolanco115 opened this issue Mar 5, 2020 · 0 comments

Comments

@apolanco115
Copy link

When using the Keyboard augmenter with special characters the following error is raised:

TypeError: argument of type 'NoneType' is not iterable

stack trace:


TypeError                                 Traceback (most recent call last)
<ipython-input-204-cc5b7c60cd49> in <module>
----> 1 aug.augment('#')

~/anaconda3/lib/python3.7/site-packages/nlpaug/base_augmenter.py in augment(self, data, n, num_thread)
     78                 # TODO: support multiprocessing for GPU
     79                 # https://discuss.pytorch.org/t/using-cuda-multiprocessing-with-single-gpu/7300
---> 80                 augmented_results = [action_fx(clean_data) for _ in range(n)]
     81             else:
     82                 augmented_results = self._parallel_augment(action_fx, clean_data, n=n, num_thread=num_thread)

~/anaconda3/lib/python3.7/site-packages/nlpaug/base_augmenter.py in <listcomp>(.0)
     78                 # TODO: support multiprocessing for GPU
     79                 # https://discuss.pytorch.org/t/using-cuda-multiprocessing-with-single-gpu/7300
---> 80                 augmented_results = [action_fx(clean_data) for _ in range(n)]
     81             else:
     82                 augmented_results = self._parallel_augment(action_fx, clean_data, n=n, num_thread=num_thread)

~/anaconda3/lib/python3.7/site-packages/nlpaug/augmenter/char/keyboard.py in substitute(self, data)
     75 
     76         for token_i, token in enumerate(tokens):
---> 77             if token_i not in aug_word_idxes:
     78                 results.append(token)
     79                 continue

TypeError: argument of type 'NoneType' is not iterable
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant