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

Can we disable the replacement for KeyboardError with non alphabet? #55

Closed
jurukode opened this issue Oct 30, 2019 · 7 comments
Closed
Labels
enhancement New feature or request

Comments

@jurukode
Copy link

Hi @makcedward,

I have purpose to augment the string to with some keyboard error. However, i don't want the characters replaced by non alphabets (e.g: punctuation). Is it possible to disable it? thanks

@makcedward makcedward added the enhancement New feature or request label Oct 31, 2019
@makcedward
Copy link
Owner

Will enhance in coming release.

Before that you may modify internal variable to achieve it

text = "testing"
aug = KeyboardAug()
aug.model.include_spec=False
aug.augment(text)

@jurukode
Copy link
Author

jurukode commented Nov 2, 2019

Ok then, thanks man!

@jurukode
Copy link
Author

jurukode commented Nov 3, 2019

@makcedward after test it, i still found the augmenter replace it with number or some symbols (e.g: *, %, @). Is there other workaround for this one? Thanks!

The reason why i need for all the non-alphabets to be removed from the replacement candidates is because i want to mimic the misspelled in the phone keyboard instead desktop keyboard. Maybe we can specific keyboard object like MobileKeyboardAug?

@makcedward
Copy link
Owner

It is fixed and ready for git's master branch. Next version will include this fix and it will be released soon. You may reinstall it before formal release by:
pip install git+https://github.com/makcedward/nlpaug.git

@jurukode
Copy link
Author

jurukode commented Nov 5, 2019

@makcedward Already upgrade it to the latest (v0.0.9), however still found cases where the non-alphabets like number and punctuation still exist.

@makcedward
Copy link
Owner

makcedward commented Nov 5, 2019

@emesha92
Thanks for reminder. Just published 0.0.10. Please try again. Here is the sample code

import nlpaug.augmenter.char as nac
aug = nac.KeyboardAug(special_char=False, numeric=False, upper_case=False)
for i in range(10):
    print(aug.augment('qwertyuiopklmzxasd'))

@jurukode
Copy link
Author

jurukode commented Nov 7, 2019

Thanks @makcedward, now it's working like a charm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants