CentOS7安装punctuator

时间:2021-07-21
本文章向大家介绍CentOS7安装punctuator,主要包括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

  

安装anaconda

# 下载
wget https://repo.anaconda.com/archive/Anaconda3-2021.05-Linux-x86_64.sh

# 安装
sh Anaconda3-2021.05-Linux-x86_64.sh

回车 查看安装协议

按几下空格, 输入yes, 同意协议

接下来是指定安装位置, 回车默认为 /root/anaconda3 , 可以自己设置位置, 不需要提前创建文件夹, 安装脚本会自动创建, 这里选择 /usr/local/anaconda3

等待安装

安装完成后, 询问是否初始化, 选择 yes

退出并重新登录

验证

(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

# 升级中如果出现请求失败, 重试即可
conda update -n base conda
conda update --all

安装punctuator

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.

  

原文地址:https://www.cnblogs.com/liuyim/p/15039251.html