CentOS7安装punctuator
配置基础环境
yum -y install apr autoconf automake bash bash-completion bind-utils bzip2 bzip2-devel chrony cmake coreutils curl curl-devel dbus dbus-libs dhcp-common dos2unix e2fsprogs e2fsprogs-devel file file-libs freetype freetype-devel gcc gcc-c++ gdb glib2 glib2-devel glibc glibc-devel gmp gmp-devel gnupg iotop kernel kernel-devel kernel-firmware kernel-headers krb5-devel libaio-devel libcurl libcurl-devel libevent libevent-devel libffi-devel libidn libidn-devel libjpeg libjpeg-devel libmcrypt libmcrypt-devel libpng libpng-devel libxml2 libxml2-devel libxslt libxslt-devel libzip libzip-devel lrzsz lsof make microcode_ctl mysql mysql-devel ncurses ncurses-devel net-snmp net-snmp-libs net-snmp-utils net-tools nfs-utils nss nss-sysinit nss-tools openldap-clients openldap-devel openssh openssh-clients openssh-server openssl openssl-devel patch policycoreutils polkit procps readline-devel rpm rpm-build rpm-libs rsync sos sshpass strace sysstat tar tmux tree unzip uuid uuid-devel vim wget yum-utils zip zlib* jq
# 下载 wget https://repo.anaconda.com/archive/Anaconda3-2021.05-Linux-x86_64.sh # 安装 sh Anaconda3-2021.05-Linux-x86_64.sh
(base) [root@iZbp18f268fd4hnuimgnahZ ~]# python3 --version Python 3.8.8 (base) [root@iZbp18f268fd4hnuimgnahZ ~]# pip3 --version pip 21.0.1 from /usr/local/anaconda3/lib/python3.8/site-packages/pip (python 3.8)
配置anaconda
添加清华大学国内源
(base) [root@iZbp18f268fd4hnuimgnahZ .punctuator]# cat /root/.condarc channels: - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/ - defaults show_channel_urls: true default_channels: - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/r - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/msys2 custom_channels: conda-forge: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud msys2: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud bioconda: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud menpo: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud pytorch: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud simpleitk: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
# 升级中如果出现请求失败, 重试即可 conda update -n base conda conda update --all
pip3 install punctuator theano
mkdir -p ~/.punctuator cd ~/.punctuator wget https://kouyu100file.oss-cn-hangzhou.aliyuncs.com/Demo-Europarl-EN.pcl
(base) [root@iZbp18f268fd4hnuimgnahZ .punctuator]# python3 Python 3.8.10 (default, Jun 4 2021, 15:09:15) [GCC 7.5.0] :: Anaconda, Inc. on linux Type "help", "copyright", "credits" or "license" for more information. >>> from punctuator import Punctuator >>> p = Punctuator('Demo-Europarl-EN.pcl') >>> print(p.punctuate('some text')) Some text.