Brat序列标注工具小结
20210616
https://blog.csdn.net/u012436149/article/details/79321112
spacy
構建語法解析樹
Brat標注工具(本地)安裝及使用
-
環境
windows10->虛擬機->Ubuntu 16.04 64位 -
前置條件
1:更新apt
sudo apt upgrade sudo apt update- 1
- 2
2:安裝git
sudo apt install git- 1
3.安裝apache2
sudo apt install apache2- 1
檢測:瀏覽器中輸入http://127.0.0.1/或者http://localhost/
進入下圖界面,則說明安裝成功4.安裝google chrome#個人習慣
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb sudo dpkg -i google-chrome-stable_current_amd64.deb- 1
- 2
-
安裝
1.下載brat
進入主頁下載 http://brat.nlplab.org/index.html
2.解壓
tar xzf 路徑/文件名 eg: tar xzf Downloads/brat-v1.3_Crunchy_Frog.tar.gz- 1
- 2
3.進入文件夾
重命名為brat
cd brat- 1
4.安裝
./install.sh- 1
5.打開#每次使用都需要python2 standalone.py- 1
6.打開瀏覽器進入即可開始標注
http://127.0.0.1:8001/index.xhtml
-
使用
1.登錄后,選中文本后會彈出窗口,選擇實體類型
2.拖動標注好的實體可以連接關系
3.雙擊標簽可對標簽進行修改或刪除
4.點擊data可導出標注好的數據
ps:未登錄不能進行標注
-
配置
annotation.conf
1.entities用來定義標注的實體名稱,其格式為每行一個實體類型,比如:人名、地名、英雄名、技能名等,可以采用tab來增加二級標注,herohero1 2.relations用來定義實體間的關系,格式為每行定義一種關系,第一列為關系類型,隨后是用逗號分隔的ArgNrelations用來定義實體間的關系,格式為每行定義一種關系,第一列為關系類型,隨后是用逗號分隔的ArgN:實體名,用來表示關系的各個相關者。relation1 Arg1:hero1, Arg2:hero1 3.events用來定義事件,每行定義一類事件,第一列為事件名,隨后是用逗號分隔的Participant:實體名,用來表示事件的各個參與者。 4.attributes用來定義屬性,每行一個屬性,第一列為屬性名,隨后是用逗號分隔的Arg:<模塊類型>, Value:屬性值,注意屬性值可以有多個- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
visual.conf#視覺配置文件1.采用中文標簽時需要 2.將annotation.conf中名稱替換 3.labels[labels]hero1 | 魏- 1
- 2
- 3
- 4
- 5
-
其他
1.中文支持
添加
n = re.sub(u'[^a-zA-Z\u4e00-\u9fa5<>,0-9_-]', '_', n)- 1
到./server/src/projectconfig.py第163行
2.給.txt文件添加.ann的標引文件find 文件夾名稱 -name '*.txt'|sed -e 's|\.txt|.ann|g'|xargs touch eg:find data/exa -name '*.txt'|sed -e 's|\.txt|.ann|g'|xargs touch- 1
- 2
給文件夾內所有.txt文件添加對應的.ann標引文件
3.添加用戶(本地不需要)
直接在config.py文件中添加 USER_PASSWORD = { 'admn': 'admin', 'test': 'test', #'user':'password', # (add USERNAME:PASSWORD pairs below this line.) }- 1
- 2
- 3
- 4
- 5
- 6
- 7
-
參考
中文文本標注工具調研以及BRAT安裝使用標注工具Brat安裝(本地)
</div><div data-report-view="{"mod":"1585297308_001","dest":"https://blog.csdn.net/p_jinsan/article/details/96152078","extend1":"pc","ab":"new"}"><div></div></div><link href="https://csdnimg.cn/release/phoenix/mdeditor/markdown_views-60ecaf1f42.css" rel="stylesheet"></div>
</article>
總結
以上是生活随笔為你收集整理的Brat序列标注工具小结的全部內容,希望文章能夠幫你解決所遇到的問題。