PYTHON-NLTK Environment Construction

Source: Internet
Author: User
Tags nltk

1. Install Python (I am installing Python2.7, directory C:\Python27)

can be downloaded to csdn, Oschina, Sina share and other websites

You can also download it on the Python website: http://www.python.org/

2. Install NumPy (optional)

Download here: Http://sourceforge.net/projects/numpy/files/NumPy/1.6.2/numpy-1.6.2-win32-superpack-python2.7.exe

Note the PY version

EXE file after download (the program will automatically search the Python27 directory)

3. Install NLTK (i downloaded nltk-2.0.3)

Download here: HTTP://PYPI.PYTHON.ORG/PYPI/NLTK

Unzip the nltk-2.0.3 to the C:\Python27 directory

Open cmd, go to C:\Python27\nltk-2.0.3 directory (input: CD C:\Python27\nltk-2.0.3)

Input command: Python setup.py install

4. Install Pyyaml:

Download here: Http://pyyaml.org/wiki/PyYAML

Note the PY version

EXE file after download (the program will automatically search the Python27 directory)

5. Open idle, enter import NLTK, no error, it means the installation was successful.

Here, the basic Python modules required for NLP are already installed, and then the Nltk_data is installed.

There are several ways to download nltk_data, here I only introduce a

6. Proceed to fifth step, already import nltk, then enter Nltk.download (), so you can open a NLTK Downloader (NLTK Downloader)

7. Note the download Directory below the downloader, I set the C:\nltk_data

8. On computer-Properties-Advanced system Settings-advanced-environment variables-System variables-NEW: Top: Nltk_data, bottom: C:\nltk_data

9. Select the package (corpus, module) you want to download, you can download it all at once (I always appear out of date during the download), or you can download it individually (I'll do it ...). )

10. How to test the package after successful installation? Enter the statement below to do so.

BrownBrown.  Words()[' The ', ' Fulton ', ' County ', ' Grand ', ' jury ', ' said ', ...]    

Success "Offline installation Nltk_data Link: Http://pan.baidu.com/s/1gfA7UoV Password: 46qy from:http://www.cnblogs.com/cheesezh/archive/2012/11/05 /2756098.html

PYTHON-NLTK Environment Construction

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.