windows10环境下搭建python2.7.5+nltk开发环境

nltk(Natural Language Tookit)实际上是python的一个开发包。对于自然语言处理任务非常有用。
===============================================================================================
===============================================================================================
在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: ltk_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
转载自:http://blog.sina.com.cn/s/blog_8af1069601019xmo.html
以大多数人努力程度之低,根本轮不到去拼天赋~
原文地址:https://www.cnblogs.com/gcter/p/8608070.html