QData / TextAttack

TextAttack 🐙 is a Python framework for adversarial attacks, data augmentation, and model training in NLP https://textattack.readthedocs.io/en/master/
https://textattack.readthedocs.io/en/master/
MIT License
2.92k stars 389 forks source link

Do not use pipeline to achieve faster generation of Chinese mask repl… #778

Closed liuyuyan2717 closed 7 months ago

liuyuyan2717 commented 7 months ago

The chinese_word_swap_masked.py calls pipline to generate masked language model substitution words, which is slow. Modified to generate Chinese mask substitution words for calling the local model

jxmorris12 commented 7 months ago

this looks good. thanks for contributing.