NLTK库来"咬文嚼字"及ubuntu 16.04系统安装nltk

作者: tengxing007 2017-01-17 09:26:23

github地址:https://github.com/nltk/nltk


官网:http://www.nltk.org/


 


开篇


NLTK – the Natural Language Toolkit – is a suite of open source Python modules, data sets and tutorials supporting research and development in Natural Language Processing


从这句话就可以看出来:NLTK - 自然语言工具包 - 是一套开源的Python模块,数据集和教程,支持自然语言处理中的研究和开发。


为什么说 “咬文嚼字”?


nltk是一个自然语言处理工具包,里面包含大量的处理文字,语言的方法。说白了就是处理语言文字,对语言文字进行”揣摩”


 


安装


下面说一下安装nltk:


说明一下;我的系统是ubuntu 16.04 系统自带python各种版本 (可以使用pip安装)


sudo apt-get update


apt-cache depends python-nltk   #与其相关的依赖包   


sudo apt-get install python-nltk


至此,安装完毕。


以下是和nltk比较友好的库,可以选择安装。


sudo apt-get install python-matplotlib   #画图表要用的 


sudo apt-get install python-numpy  #科学计算库


 


基本使用


engxing@tengxing-Lenovo-Y50-70:~$ python


Python 2.7.12 (default, Nov 19 2016, 06:48:10) 


[GCC 5.4.0 20160609] on linux2


Type "help", "copyright", "credits" or "license" for more information.


>>> import nltk


>>> nltk.download()


showing info https://raw.githubusercontent.com/nltk/nltk_data/gh-pages/index.xml


会下载数据模块,之后打开如下:




MOdels数据包可以下载需要的。


 


本文永久更新地址:http://www.linuxdiyf.com/linux/27873.html

相关资讯