The Naïve Bayes classifier using TextBlob
TextBlob
is an interesting library that has a collection of tools for text processing purposes. It comes with the API for natural language processing (NLP) tasks, such as classification, noun phrase extraction, part-of-speech tagging, and sentiment analysis.
There are a few steps involved to make sure that one can use TextBlob
. Any library that works with NLP needs some corpora; therefore, the following sequence of installation and configuration needs to be done before attempting to use this interesting library:
Installing
TextBlob
(either viaconda
orpip
)Downloading corpora
Installing TextBlob
Using
binstar search -t conda textblob
, one can find where to install it for anaconda users. More details can be found in Appendix, Go Forth and Explore Visualization.
Downloading corpora
The following command will let one download corpora
:
$ python -m textblob.download_corpora [nltk_data] Downloading package brown to [nltk_data] /Users/administrator/nltk_data...