NLP Natural Language Processing Study Note II (Preliminary examination)

Source: Internet
Author: User
Tags nltk

Preface: The use of Python for natural language processing has a very good library. It's called NLTK. Here is the first attempt to NLTK. Installation: 1. It is easy to install PIP, thanks to the Easy_install CentOS7 comes with. You can do it with one line of command. *->easy_install pip in terminal console2. Verify that PIP is available Pip is a Python package management tool. We run pip to make sure CentOS is available under. * in terminal console->pip-v Note the case of the parameter3. Install NLTK using PIP * in terminal console->pip install-u nltkNLTK use: After the installation is complete we can experiment with the Python interpreter. Of course, writing Python in the parser under command line is really a bit uncomfortable. The next section will recommend a useful Python IDE (integrated development environment) for everyone. Don't be a little impatient. Let's start with the first little experiment. * In terminal console->python enter the Python interpreter (command line)->print ("Hello python") * Continue typing->import nltk->nltk.download () * Download We need to anticipate the library press the L key to browse the list (enter to page). What we need to download is the book tag's expected library as data for our first little experiment. * download book corpus data. Press the D key and enter the book carriage return. Wait for the download, download done can press the L key to see all the data installed. Then press the Q key to exit. Press the L key to see which ones are expected to be installed. Enter the page. The first small experiment search can now start the first small experiment, according to the book's example we Search "Moby Dick" in the word monstrous. Of course, this book is already included in the expected data we just downloaded. * Imported Nltk.book->from nltk.book import *->text1 print out Moby Dick * Finding the word monstrous is simple enough to use the concordance function. is not very simple. Altogether there are 11 locations, and the context in which the word appears is displayed. So far we have opened the door to NLP learning. is not very excited about it. Let's work together.

NLP Natural Language Processing Study Note II (Preliminary examination)

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.