centos安装成功bart标注工具

说明:

网上大部分教程是基于ubutu,自己的服务器是centos,期间出现很多问题,记录如下。

主要问题是谷歌浏览器中访问8001端口下载了一个index.xhtml,而不是直接打开

原因:需要图形化界面,解决方案,httpd,firefox,Xmanager

1.安装brat

下载,http://brat.nlplab.org/installation.html,brat-v1.3_Crunchy_Frog.tar.gz这个文件

tar -xzf brat-v1.3_Crunchy_Frog.tar
cd brat-v1.3_Crunchy_Frog
./install.sh

注:基本不会有问题

2.安装httd

机器python 环境问题

由于机器使用了python3。所以要切换到python2的环境

vi ~/.bashrc 
alias python='/usr/bin/python2.7'
vi /etc/profile path 也要修改

yum的python环境问题

vi /usr/bin/yum 和vi /usr/libexec/urlgrabber-ext-down
修改头 #!/usr/bin/python => #!/usr/bin/python2.7

http服务问题

Job for httpd.service failed because the control process exited with error code.see “systomctl status httpd.service” and “journalctl -xe” for details.

先用yum卸载httpd和mod_wsgi,

命令:yum remove httpd mod_wsgi;

然后再安装yun -y install httpd mod_wsgi 就可以了
安装完成后 service httpd restart 即可 问题基本排除

3.安装firefox:

遇到的坑使用官网下载的Firefox-latest.tar.bz2安装包遇到了各种问题,

解决了很多问题,不知道会对下面操作是否有影响

解决方案:使用yum install firefox

4.安装Xmanager

参考 https://blog.csdn.net/yongwan5637/article/details/84060709

网盘地址 https://pan.baidu.com/s/1jsSeCAv3VHBZiqGh_HURlA

遇到问题:Xmanager6遇到一个无法解决的问题,所以选择Xmanager5

5.开启

在centos中启动 brat :cd brat-v1.3_Crunchy_Frog 运行python standalone.py

windows启动Xmanager-Passive 

在centos中新窗口执行 expot DISPLAY=windowsip:0.0

在centos执行 xclock 测试是否成功,如果成功会在windows有个钟表页面

在centos执行firefox centosIP:8001  (brat服务)

6.中文

在brat-v1.3_Crunchy_Frog/data随便写点文件内容为中文

在brat-v1.3_Crunchy_Frog 路径执行命令 find data -name '*.txt' | sed -e 's|.txt|.ann|g' | xargs touch

brat-v1.3_Crunchy_Frog/server/src/projectconfig.py

normalize_to_storage_form(t)函数

注释#n = re.sub(r'[^a-zA-Z0-9_-]', '_', n)

添加n = re.sub(u'[^a-zA-Zu4e00-u9fa5<>,0-9_-]', '_', n)

参考:https://blog.csdn.net/u014028063/article/details/89329306

https://blog.csdn.net/anyedianxia/article/details/96832229

https://blog.csdn.net/yongwan5637/article/details/84060709

https://www.cnblogs.com/xuzhaoyang/p/11264609.html

https://www.wandouip.com/t5i90589/

https://www.cnblogs.com/lincj/p/5467911.html

原文地址:https://www.cnblogs.com/pergrand/p/13038764.html