Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Natural language processing (NLP) is an exciting field in data science and artificial
intelligence that deals with teaching computers how to extract meaning from text. In this
guide, well be touring the essential stack of Python NLP libraries.
These packages handle a wide range of tasks such as part-of-speech (POS) tagging,
sentiment analysis, document classification, topic modeling, and much more. Recommended Reading
We write every guide with the practitioner in mind. There are dozens of packages
for NLP out there... but you'll cover all the important bases once you master a handful of
them. This is an opinionated guide that features the 5 Python NLP libraries we've found
to be the most useful.
https://elitedatascience.com/python-nlp-libraries 1/4
7/19/2017 5 Heroic Python NLP Libraries
NLTK is also popular for education and research. On its own website, NLTK claims to be
an "an amazing library to play with natural language."
In our experience, the key word there is "play." NLTK has over 50 corpora and lexicons,
9 stemmers, and dozens of algorithms to choose from. It's an academic researcher's
theme-park.
Yet, this is also one of NLTK's major downsides. It's heavy and slippery, and it has a
steep learning curve. The second major weakness is that it's slow and not production-
ready.
Resources
TextBlob makes text processing simple by providing an intuitive interface to NLTK. It's a
welcome addition to an already solid lineup of Python NLP libraries because it has a
gentle learning curve while boasting a surprising amount of functionality.
For example, let's say you wanted to find a text's sentiment score. You can do that out of
the box:
Python
from textblob import TextBlob
opinion = TextBlob("EliteDataScience.com is dope.")
opinion.sentiment
Free
By default, the sentiment analyzer is the PatternAnalyzer from the Pattern library. But 7-Day Crash Course:
what if you wanted to use a Naive Bayes analyzer? You can easily swap to a pre-trained
Data Science & Machine
implementation from the NLTK library.
Learning!
Python
Jumpstart your data science and machine learning
from textblob import TextBlob
journey with our practical, super intuitive course.
from textblob.sentiments import NaiveBayesAnalyzer
opinion = TextBlob("EliteDataScience.com is dope!", analyzer=NaiveBayesAnalyzer(
opinion.sentiment First Name
TextBlob is a simple, fun library that makes text analysis a joy. We'll at least use TextBlob
Email Address
for initial prototyping for almost every NLP project.
https://elitedatascience.com/python-nlp-libraries 2/4
7/19/2017 5 Heroic Python NLP Libraries
"The Mercenary" is actually written in Java, not Python. You can get around this with
Python wrappers made by the community.
Many organizations use CoreNLP for production implementations. It's fast, accurate, and
able to support several major languages.
Resources
SpaCy is minimal and opinionated, and it doesn't flood you with options like NLTK does.
Its philosophy is to only present one algorithm (the best one) for each purpose. You don't
have to make choices, and you can focus on being productive.
Because it's built on Cython, it's also lightning-fast. Folks have called spaCy "state-of-
the-art,"
and it's hard to disagree. Its main weakness is that it currently only supports
English. Free 7-Day Crash Course: Data Science
& Machine Learning!
SpaCy is newer, so its support community is not as large as some other libraries'. Yet, its
approach to NLP is so compelling that it could possible dethrone NLTK.
If you're building a new application or revamping an old one (and you only need English
support), then we strongly recommend trying spaCy.
Resources
<<spaCy Documentation - Official documentation and quickstart guide.
Intro to NLP with SpaCy - Short tutorial showcasing spaCy's functionality.
Plus, the sub-field semantics analysis (or topic modeling), is one of the most exciting Email Address
areas of modern natural language processing.
Sign Up Now
Resources
https://elitedatascience.com/python-nlp-libraries 3/4
7/19/2017 5 Heroic Python NLP Libraries
Copyright 2017 EliteDataScience.com All Rights Reserved Home Terms of Service Privacy Policy
First Name
Email Address
Sign Up Now
https://elitedatascience.com/python-nlp-libraries 4/4