美文网首页
离线安装NLTK Data

离线安装NLTK Data

作者: 一路向后 | 来源:发表于2020-10-24 20:34 被阅读0次

1.下载nltk_data

下载地址: https://github.com/nltk/nltk_data/tree/gh-pages

2.解压nltk_data

$ unzip nltk_data-gh-pages.zip
$ cd nltk_data-gh-pages/packages
$ sudo mkdir /usr/share/nltk_data
$ sudo cp -r * /usr/share/nltk_data/

3.编写解压脚本

#!/bin/bash

list=$(find . -name *.zip)

for file in $list
do
       path=${file%/*}
       name=${file##*/}

       cd $path
       unzip $name
       cd -
done

chmod 775 -R *

list=$(find . -type f)
for file in $list
do
        chmod 644 $file
done

4.解压所有数据包

$ cd /usr/share/nltk_data/
$ sudo ./unzip.sh

相关文章

网友评论

      本文标题:离线安装NLTK Data

      本文链接:https://www.haomeiwen.com/subject/krywmktx.html