dsfsi/textaugment

`add_word` method returns `None` after 10 tries getting synonyms

jonsnowseven opened this issue · 3 comments

if counter >= 10:
return

I am getting an error when I supply a big text to random_insertion and for some reason, after 10 synonym retries for my text, this function returns None.

Is there some reason for this? Couldn't the function just continue the while cycle?

Thank you in advance.

Thanks @jonsnowseven We will look into it.

A while section would not be advised.

Sometimes not all the words have synonyms. May @jonsnowseven share an example of the sentence used.
@vukosim Increasing 10 to 20 may work?

@JosephSefara, I can find an example but I need to redact it. Yes, I totally get that all the words do not have synonyms. But why just no continue with the search with other words instead of returning None which breaks the code?