windows环境下搭建python+nltk开发环境

windows环境下搭建python+nltk开发环境

nltk(Natural Language Tookit)实际上是python的一个开发包。对于自然语言处理任务非常有用。
===============================================================================================
NLTK 2.0官网http://nltk.org/install.html
===============================================================================================
在windows 32-bit 下的安装步骤如下:
1、Install Python
2、Install Numpy (optional)
3、Install NLTK
4、Install PyYAML
5、Test installation: Start>Python27, then type import nltk
===============================================================================================
1、首先,安装python 2.7
===============================================================================================
2、安装Numpy(可选操作)
   -》直接下载
   -》双击运行,下一步下一步点击。
windows环境下搭建python+nltk开发环境
   -》安装完成。
===============================================================================================
3、安装NLTK。
  -》 nltk-2.0.4.win32.exe (md5)( Python 2.5 or higher
  -》双击运行,一次点击下一步
windows环境下搭建python+nltk开发环境
   -》安装完成
===============================================================================================
4、安装PyYAML。
   -》Download and Installation-》Windows installers:
   -》http://pyyaml.org/download/pyyaml/PyYAML-3.10.win32-py2.7.exe (for Python 2.7)
   -》双击运行
windows环境下搭建python+nltk开发环境
   -》完成。
===============================================================================================
5、NLTK数据源下载。
   -》在python IDLE中键入:
     >>> import   nltk
     >>> nltk.download()
     会输出:showing info http://nltk.github.com/nltk_data/
     并出现图:
     windows环境下搭建python+nltk开发环境 
   -》选择all,设定好下载路径Download Directory(例如设定D:\nltk_data)。
      然后点击Download,系统就开始下载NLTK的数据包了,下载的时间比较漫长,大家要耐心等待。
   -》或者也可以到NLTK Corpora: http://nltk.org/nltk_data/  来手动下载。
      这个页面下的文档就是上图包含的所有的内容
     windows环境下搭建python+nltk开发环境
   -》下载数据完成。
===============================================================================================
6、来一个简单的nltk功能小测试
   输入: from nltk.book import  *
   >>> from nltk.book import  *
     输出:
*** Introductory Examples for the NLTK Book ***
Loading text1, ..., text9 and sent1, ..., sent9
Type the name of the text or sentence to view it.
Type: 'texts()' or 'sents()' to list the materials.
text1: Moby Dick by Herman Melville 1851
text2: Sense and Sensibility by Jane Austen 1811
text3: The Book of Genesis
text4: Inaugural Address Corpus
text5: Chat Corpus
text6: Monty Python and the Holy Grail
text7: Wall Street Journal
text8: Personals Corpus
text9: The Man Who Was Thursday by G . K . Chesterton 1908
===============================================================================================
7、更多功能,
     尽在《Natural Language Processing with Python》: http://nltk.org/book/
=================

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值