文本对抗攻击工具:OpenAttack试用
昨天,清华大学自然语言处理与社会人文计算实验室开源了一个针对文本对抗攻击的工具包,名字叫OpenAttack。
官方介绍:OpenAttack:文本对抗攻击工具包
项目网址:https://github.com/thunlp/OpenAttack
今天体验了一下,带来一些使用介绍。
安装
推荐使用源码安装
git clone https://github.com/thunlp/OpenAttack.git
cd OpenAttack
python setup.py install
运行攻击demo
官方提供了一个demo文件,让大家可以尝试攻击操作。
运行发现使用了NLTK和NLTK的扩展数据包,NLTK的数据包是出了名的大和难下,怎么办呢?
除了使用科学上网外,可以用以下的方法来手动下载数据包。
import nl…
Keep reading with a 7-day free trial
Subscribe to AIPwn to keep reading this post and get 7 days of free access to the full post archives.