graykode / nlp-tutorial

Natural Language Processing Tutorial for Deep Learning Researchers
https://www.reddit.com/r/MachineLearning/comments/amfinl/project_nlptutoral_repository_who_is_studying/
MIT License
14.07k stars 3.91k forks source link

if statement to elif statement #9

Closed SpellOnYou closed 5 years ago

SpellOnYou commented 5 years ago

The second "if" statement must be replaced with an "elif" statement. Then, 10% (0.2 * 0.5 = 0.1) will be replaced with randomly extracted tokens.

If you put two "if" statements in succession it can cause duplication(, random_token at same position), and tokens will be randomly replaced to a probability of 50%. Not a 10%.

graykode commented 5 years ago

Thanks for Contribution, you are right I will merge it