Installing TextBlob

The first step is to install the library into the notebook environment. Assuming you are using Anaconda for running the notebook, you can use conda to install TextBlob (https://anaconda.org/conda-forge/textblob). Assuming you have conda installed, the command to install TextBlob is:

$ conda install -c conda-forge textblob

This should install the required package into your Anaconda environment. 

More often, when running the example snippet from this book, you will come across situations where one or more packages are missing in your system or Anaconda installation. You can install the missing libraries using the instructions found at https://conda.io/docs/user-guide/tasks/manage-pkgs.html#installing-packages

Once you have the TextBlob library installed, let's import it into our notebook:

from textblob import TextBlob

And let's perform some simple text-processing on a paragraph:

text = TextBlob("Twitter is one of the most important social media used in today's world. It provides the platform to share people's opinions, facts and information regarding person, place, animals or things. These tweets are used by several private, governmental and non-governmental organizations to mine different types of information including business intelligence.")

We store the text in a variable. Now we can generate a lot of simple text-processing parameters.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.14.129.194