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.98k stars 397 forks source link

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

Closed liuyuyan2717 closed 8 months ago

liuyuyan2717 commented 8 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 8 months ago

this looks good. thanks for contributing.