11月01, 2019

NLP标注工具brat 配置文件说明

BRAT文本标注工具提供了根据项目定制的功能,可以提高标注效率,比如标签设计,快捷键,搜索等。

快速搭建brat

通过docker:

docker run --name=brat -d -p 38080:80 -e BRAT_USERNAME=brat -e BRAT_PASSWORD=brat -e BRAT_EMAIL=brat@example.com cassj/brat

启动会拉取镜像,耐心等待,然后打开IP:38080,使用brat,brat登录

braf 的四类配置文件

the configuration of an annotation project is controlled by four files:

  • annotation.conf: 标记类型 configuration
  • visual.conf: annotation显示配置
  • tools.conf: annotation工具配置
  • kb_shortcuts.conf: 键盘快捷键 keyboard shortcut tool configuration

annotation.conf

# 实体类型
[entities]
# 每行一个实体类型  
Protein
Simple_chemical
Complex
Organism

# 事件
[events]

# 事件名称  参数名称:参数类型
Gene_expression Theme:Protein
Binding Theme+:Protein
Positive_regulation Theme:<EVENT>|Protein, Cause?:<EVENT>|Protein
Negative_regulation Theme:<EVENT>|Protein, Cause?:<EVENT>|Protein

# 关系
[relations]

# 关系名称 关系的属性,syntax ARG:TYPE (where ARG are, by convention, Arg1 and Arg2)
Part-of Arg1:Protein, Arg2:Complex
Member-of Arg1:Protein, Arg2:Complex

# TODO: Should these really be called "Equivalent" instead of "Equiv"?
Equiv Arg1:Protein, Arg2:Protein, <REL-TYPE>:symmetric-transitive
Equiv Arg1:Simple_chemical, Arg2:Simple_chemical, <REL-TYPE>:symmetric-transitive
Equiv Arg1:Organism, Arg2:Organism, <REL-TYPE>:symmetric-transitive

# 属性定义
[attributes]

# 名称  参数
Negation        Arg:<EVENT>
Confidence        Arg:<EVENT>, Value:Possible|Likely|Certain

Visual configuration (visual.conf) 可视化configuration包含两部分

  • [labels]
  • [drawing]

The [labels] 定义标记类型UI上如何显示:

Simple_chemical | Simple chemical | Chemical
标记类型  |   全称  |  显示文字

使用"|"隔开,第一部分是里定义的

The [drawing] 用于定义显示样式,比如定义标记的颜色等

[drawing]


SPAN_DEFAULT    fgColor:black, bgColor:lightgreen, borderColor:darken
ARC_DEFAULT color:black, arrowHead:triangle-5
ATTRIBUTE_DEFAULT   glyph:*

工具栏配置 (tools.conf)

The annotation tool configuration file, tools.conf, is divided into the following sections:

  • [options]
  • [search]
  • [normalization]
  • [annotators]
  • [disambiguators]

快捷键(kb_shortcuts.conf)

选中标记后,键盘上按快捷键,可以快速切换选项

P       Protein
S Simple_chemical
X Complex
O Organism

C Cause
T Theme

参考

https://www.cnblogs.com/xiaoqi/p/brat-config.html

本文链接:http://57km.cc/post/brat configuration.html

-- EOF --

Comments