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

Reducing the number of replaced characters #3

Closed
ricardopieper opened this issue Jun 11, 2019 · 1 comment
Closed

Reducing the number of replaced characters #3

ricardopieper opened this issue Jun 11, 2019 · 1 comment
Labels
bug Something isn't working

Comments

@ricardopieper
Copy link
Contributor

ricardopieper commented Jun 11, 2019

Hi Edward, thank you for this great work.

I'm trying to use the QwertyAug augmenter, but I'm having some issues controlling the number of replaced characters.

For instance:

aug = naf.Sequential([
    nac.QwertyAug()
])

aug.augment("qual o motivo do meu cartao ainda estar bloqueado?")

This results in waaay too many characters being replaced:

 wual 9 motibo di m3u carfao aindx esta# bloquezso?

I saw that there are some parameters that affect the amount of characters. For instance, if I pass aug_p = 0.00000000000000001 still way too many characters get replaced. Now I show a test with the sentence "why is my credit card still blocked?":

'wh5 id hy crevit carw stilp blpcked?'

There's barely any meaning in this sentence anymore.

The aug_p seems to be the correct parameter. If I pass 1, then all characters change.

Is there a way to further reduce the chance that a given character gets replaced? Ideally, in a sentence with that size, I'd like to replace like 2 or 3 characters.

@makcedward makcedward added the bug Something isn't working label Jun 12, 2019
@makcedward
Copy link
Owner

In coming release, "aug_word_p" and "aug_char_p" parameters will be introduced to Character Augmenter (OcrAug, QwertyAug, RandomCharAug). It controls the percentage of word (or character) for augmentation.

Example
aug = RandomCharAug(aug_word_p=0.3, aug_char=0.3)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants