4

Preprocessing – Stemming, Tagging, and Parsing

Before we can start assigning emotions to texts, we have to carry out a range of preprocessing tasks to get to the elements that carry the information we want. In Chapter 1, Foundations, we briefly covered the various components of a generic NLP system, but without looking in detail at how any of these components might be implemented. In this chapter, we will provide sketches and partial implementations of the tools that are most likely to be useful for sentiment mining – where we give a partial implementation or a code fragment for something, the full implementation is available in the code repository.

We will look at the earlier stages of the language processing pipeline in detail. The texts ...

Get Machine Learning for Emotion Analysis in Python now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.