1、介绍
BRAT是一个基于web的文本标注工具,主要用于对文本的结构化标注,用BRAT生成的标注结果能够把无结构化的原始文本结构化,供计算机处理。利用该工具可以方便的获得各项NLP任务需要的标注语料。
2、安装
a)brat的安装非常简单,只需要unix-like系统和web server支持cgi环境即可,具体安装流程官网写的很清楚,http://brat.nlplab.org/installation.html,需要注意的是web server下各个路径的权限需要设置好,python需要支持sqlite
./install.sh
and follow the instructions. You will be prompted for the following information:
- brat username (e.g. “editor”)
- brat password (for the given user, e.g. “annotate”)
- administrator contact email (e.g. “admin@example.com”)
需要输入超级用户的用户名和密码
b)启动python standalone.py
3、关键问题
3.1 支持中文
brat本身是不支持中文的,如果在配置文件里定义中文会报错,解决办法是修改./server/src/projectconfig.py文件的第163行,加上中文支持即可:
n = re.sub(u'[^a-zA-Z\u4e00-\u9fa5<>,0-9_-]', '_', n)
注意:增加一行
3.2 增加用户
官方文档:
If you want to add additional users, you can edit the config.py file, which contains further instructions.
找到config.py 对应的行,增加:
USER_PASSWORD = {
'admn': 'admin',
'test': 'test',
# (add USERNAME:PASSWORD pairs below this line.)
}
重新启动后,使用test就可以登录了
注意:当前用户只能针对自己的标注进行修改,并不能修改其他人进行的标注
3.3 导入collection
导入文件的时候,必须要文件符合:文件名.xxx和文件名.ann 一一对应的格式即可
4、参考文档
你爱我吗?企鹅风讯利用BRAT进行中文情感分析语料标注掌握玩家心 http://wetest.qq.com/lab/view/31.html
构想:中文文本标注工具(非常好文档) http://dataguru.cn/article-12531-1.html
BRAT对应的实体格式(brat standoff format) http://brat.nlplab.org/standoff.html
人工智能标注工具 https://www.cnblogs.com/alexanderkun/p/6936732.html
BRAT使用说明: http://blog.sina.com.cn/s/blog_4c9dc2a10102wy3f.html