brat 的下载地址http://brat.nlplab.org/

Ubuntu16.04安装CGI环境

  1. 安装Apache2
sudo apt install apache2
  1. 配置CGI

1)打开文件/etc/apache2/sites-enabled/000-default.conf

sudo gedit /etc/apache2/sites-enabled/000-default.conf

找到以下的内容:
#Include conf-available/serve-cgi-bin.conf

修改为 Include conf-available/serve-cgi-bin.conf (去掉注释) 。

2)打开文件/etc/apache2/conf-available/serve-cgi-bin.conf

sudo gedit /etc/apache2/conf-available/serve-cgi-bin.conf

找到以下的内容:

ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory “/usr/lib/cgi-bin”>
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Require all granted

修改为:

ScriptAlias /cgi-bin/ /var/www/html/cgi-bin/
<Directory “/var/www/html/cgi-bin/”>
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Require all granted
AddHandler cgi-script cgi

3)打开文件/etc/apache2/mods-available/cgid.load

sudo gedit /etc/apache2/mods-available/cgid.load

在LoadModule cgid_module /usr/lib/apache2/modules/mod_cgid.so下加上:
AddHandler cgi-script .cgi .pl .py .sh

4)链接文件:

sudo ln -s /etc/apache2/mods-available/cgid.load /etc/apache2/mods-enabled/cgid.load

5)重启Apache2,终端输入:

sudo /etc/init.d/apache2 restart

6)新建/cgi-bin文件夹,终端输入:

sudo mkdir /var/www/html/cgi-bin/

7)创建一个CGI文件

在/var/www/html/cgi-bin/下新建helloworld.c文件

sudo touch /var/www/html/cgi-bin/helloworld.c
sudo vim /var/www/html/cgi-bin/helloworld.c

文件中的内容:

#include <stdio.h>
int main()
{printf("Content-Type: text/html\n\n");printf("Hello World!\n");return 0;
}

插入模式:可以输入文本,在正常模式下,按i、a、o等都可以进入插入模式。
按Esc,输入:wq–保存并退出。

编译源文件:

sudo gcc /var/www/html/cgi-bin/helloworld.c -o /var/www/html/cgi-bin/helloworld.cgi

修改CGI文件权限:

sudo chmod 755 /var/www/html/cgi-bin/helloworld.cgi
  1. 测试
    浏览器键入:http://localhost/cgi-bin/helloworld.cgi,在页面可以看到 Hello World!

安装brat标注工具

  1. 下载好的brat安装包,解压
tar -zxvf brat-v1.3_Crunchy_Frog.tar.gz
  1. 由于已经配置过CGI保证系统服务器可用,则可以直接安装
cd /brat-v1.3_Crunchy_Frog/
./install.sh

\quad安装的过程中要求设置用户名,密码,邮箱 出现 The installation has finished, you are almost done. 及后续的提示则安装成功

  1. 启动浏览器
#需要Python2
python2 standalone.py

\quad出现浏览器的url是http://127.0.0.1:8001

  1. 访问url, 界面如下:

\quad若出现错误UnicodeDecodeError: ‘ascii’ codec can’t decode byte 0xe6 in position 10: ordinal not in range(128),打开/server/src/server.py文件,在开头添加如下代码:

import sys
reload(sys)
sys.setdefaultencoding('utf8')
  1. 支持中文

\quadbrat本身是不支持中文的,如果在配置文件里定义中文会报错,解决办法是修改/server/src/projectconfig.py文件的第163行,加上中文支持即可: 将英文的这句话注释掉,并添加如下内容:

n = re.sub(u'[^a-zA-Z\u4e00-\u9fa5<>,0-9_-]', '_', n)
  1. brat自定义实体类型

\quad首先,在brat项目的data目录下新建一个project目录,然后在brat项目的主目录下找到annotation.conf文件,复制到project目录。

# Simple text-based definitions of hierarchial ontologies of
# (physical) entity types, relation types, event types, and
# attributes.
# This is a minimal example configuration, based (loosely) on some
# ACE'05 entity, relation and event definitions
# (http://projects.ldc.upenn.edu/ace/annotation/2005Tasks.html).
# Please edit this according to the needs of your annotation.[entities]# Definition of entities.
# Format is a simple list with one type per line.时间
地点
人名
组织名
产品名[relations]# Definition of (binary) relations.
# Format in brief: one relation per line, with first space-separated
# field giving the relation type and the rest of the line the
# comma-separated arguments in ROLE:TYPE format. The roles are
# typically "Arg1" and "Arg2".夫妻             Arg1:人名, Arg2:人名
朋友             Arg1:人名, Arg2:人名
情侣             Arg1:人名, Arg2:人名
同事             Arg1:人名, Arg2:人名
父母             Arg1:人名, Arg2:人名
合作             Arg1:人名, Arg2:人名
兄弟姐妹         Arg1:人名, Arg2:人名
师生             Arg1:人名, Arg2:人名属于             Arg1:人名, Arg2:机构
别名             Arg1:人名, Arg2:人名, <REL-TYPE>:symmetric-transitive[events][attributes]
  1. 准备数据
    \quad把数据放进文件夹中,比如把数据(即filename.txt文件,filename为文件名)放在data/project/中。每一个句子独立成一个.txt文件。然后按下列操作就可以给data文件夹中每一个.txt文件都产生一个.ann文件。
find data -name '*.txt' | sed -e 's|\.txt|.ann|g' | xargs touch

Ubuntu16.04安装文本标注工具brat相关推荐

  1. 文本标注工具-brat安装

    参考:Ubuntu16.04安装文本标注工具brat brat使用参考:BRAT的安装.配置.标注操作

  2. 用深度学习做命名实体识别(二):文本标注工具brat

    本篇文章,将带你一步步的安装文本标注工具brat. brat是一个文本标注工具,可以标注实体,事件.关系.属性等,只支持在linux下安装,其使用需要webserver,官方给出的教程使用的是Apac ...

  3. 文本标注工具BRAT的安装与配置

    文本标注工具BRAT的安装与配置 因此博客是安装完成之后回顾下写的,所以没有配图说明,仅记录下安装步骤及出现的一些问题,具体安装路线如下: 1.win10下VirtualBox与Ubuntu的安装 B ...

  4. ubuntu下文本标注工具BRAT全程离线安装

    1 Apache离线安装 1.1 软件下载 1.1.1 httpd文件 从http://httpd.apache.org/download.cgi下载httpd文件 1.1.2 apr文件 可到官网h ...

  5. 【文本标注】文本标注工具brat的使用

    brat是linux下的一款应用于webserver端的文本标注工具,可用于标注如下类型信息: (1)实体:命名实体,可用于NER: (2)关系:实体间关系,可用于关系抽取: (3)事件:实体参与的事 ...

  6. 文本标注工具--BRAT 安装

    brat是linux下的一款应用于webserver端的文本标注工具,可用于标注如下类型信息: 实体:命名实体,可用于NER: 关系:实体间关系,可用于关系抽取: 事件:实体参与的事件: 属性:事件或 ...

  7. 文本标注工具BRAT安装使用

    1.介绍 BRAT是一个基于web的文本标注工具,主要用于对文本的结构化标注,用BRAT生成的标注结果能够把无结构化的原始文本结构化,供计算机处理.利用该工具可以方便的获得各项NLP任务需要的标注语料 ...

  8. Ubuntu16.04安装画流程图工具Dia、微信、网易云音乐、钉钉、百度云盘、搜狗输入法、wps、企业邮箱配置等(持续更新)

    日常工作使用Ubuntu系统,但从windows平台迁移过来很不习惯.会陆续记录一些插件.软件的安装.如微信.钉钉.百度网盘.企业邮箱配置等. 微信.钉钉.百度云盘 github上已有将deepin打 ...

  9. NLP标注工具Brat

    https://www.cnblogs.com/xiaoqi/p/brat-config.html [文本标注]文本标注工具brat的使用 2019常用NLP标注工具简单介绍 NLP标注工具: YED ...

最新文章

  1. Redis持久化存储详解(一)
  2. unity_简单五子棋的实现(无AI)
  3. Sql Server相关报错解决
  4. CTFshow 命令执行 web74
  5. java 菜单 分隔符_在Java中使用分隔符连接值列表最优雅的方法是什么?
  6. 01.神经网络和深度学习 W2.神经网络基础
  7. Linux下MongoDB安装和配置详解
  8. Winform 实现像菜单一样弹出层
  9. 读书笔记之深入理解Java虚拟机
  10. 视频教程-轻松搞定Spring全家桶(初识篇)-Java
  11. 无线通信信号的功率表示方法中dBm,dB与w的换算关系
  12. 椭圆函数与模函数(2012.10出版)(2013-01-16 09:34:57)
  13. SharePoint - CAML
  14. Mysql数据库死锁实战-锁的基础知识
  15. OPPO 数据湖统一存储技术实践
  16. ubuntu系统录屏recordmydesktop与ogv视频转换MP4
  17. 强力删除文件或文件夹
  18. L1 VS L2(深度学习中的L1与L2)
  19. [ Azure | Az-900 ] 基础知识点总结(二) - 核心组件服务
  20. BUAA(2021春)实验:树的构造与遍历——根据提示循序渐进(可惜提示有问题Ծ‸Ծ)

热门文章

  1. 断食、清肠 三日记录
  2. C# 从零开始写 SharpDx 应用 画三角
  3. win10 nginx部署前端项目(静态资源服务器和HTML)
  4. php验证码手册,验证码 - ThinkPHP 5.1 完全开发手册
  5. leetcode 1359. Count All Valid Pickup and Delivery Options(有效的快递序列数目)
  6. 下关便装特沱微刻辩识
  7. CSCD.中国科学引文数据库核心库和引文库来源期刊列表(2007年-2008年)
  8. Spring Boot cache backed guava/caffeine
  9. fiddler--HTTP协议调试工具
  10. 字节跳动全链路压测(Rhino)的实践