We are submerged in a sea of words: emails, social media posts, reviews, and articles overwhelm us daily. How can we transform this chaos into valuable information?
Text analysis is the compass that helps us navigate through the noise, focusing only on what truly matters. It helps us extract every useful detail without missing anything important.
Within the entire machine learning model creation pipeline, you are at the point highlighted in blue.

Imagine having to read through thousands of online reviews to understand whether a product is liked or not. Or having to analyze hundreds of emails to find the most urgent ones. It would be an endless and boring task, right? This is where text analysis comes into play: a technique that transforms large amounts of text into data that we can easily analyze.
But how exactly does it work? Text analysis allows us to extract useful information from written texts, such as emails, social media comments, articles, or reviews. It doesn’t just read word by word but goes deeper, finding patterns, emotions, or key ideas hidden between the lines. For example, thanks to this technique, it’s possible to discover whether product reviews are mostly positive or negative without reading them one by one.
What is the purpose of all this? The applications are endless. Companies use text analysis to monitor what customers are saying on social media, journalists to understand opinion trends, and researchers to analyze large quantities of documents. It’s a tool that saves time and helps make smarter decisions based on concrete data.
Data cleaning is essential to obtain accurate analysis, especially when working with texts from emails, social media posts, or reviews. These texts often contain noise and irrelevant information that can compromise the quality of the analysis.
Why is it so important? Superfluous words and phrases can confuse the interpretation of data and negatively affect the results. Additionally, texts may contain errors and variations in word forms, which can lead to an inaccurate representation of the data.
Data cleaning helps to:
- Remove distortions
- Ensure that only relevant information is considered
- Obtain more precise results
- Improve the effectiveness of the analysis
Let’s now look at three fundamental techniques for text data cleaning.
Removal of Stopwords
The first step in data cleaning is to remove words that do not contribute to the main meaning of the text, called stopwords. These are common words like articles and pronouns that, while frequent in language, do not add significant value to the analysis.
This process is particularly useful when we want to focus on specific elements of the text, such as emotions or sentiment.
To give a concrete example, let’s consider a short text:

In this case, the words “the”, “has”, “an”, “for”, and “and” are stopwords. These words do not contain information, and considering them could only confuse the model and the analysis that will be performed.
Now, the text remains focused on the words that express the author’s opinion, such as “interesting” and “liked”, making the sentiment of the review clearer. This helps achieve more precise results, as we focus only on the information that truly matters.
Stemming
Another important step in data cleaning is stemming, which consists of reducing words to their common roots. This process is useful because many different words can have the same basic meaning, and reducing them to a common form helps simplify the analysis.
To better understand how stemming works, let’s analyze the same sentence as before:
Text without stopwords: “city launched awareness campaign environment environmental education.”
Let’s consider the words ‘environment’ and ‘environmental’. Although these words have similar meanings, they are treated as different terms during analysis because they are made up of different letters. With the stemming process, both are reduced to their common root ‘environment’, allowing them to be considered equivalent since they share the same meaning. This operation can be extended to all other words, resulting in:

Text after stemming: “city launch awar campaign for the environment environment educ.”
Now, all the variants of the word “environment” are reduced to a common form. This helps prevent similar words from being counted separately and facilitates a clearer and more consistent understanding of the data. In this way, text analysis becomes simpler and more accurate, as we focus on the common roots of words (and thus their meaning) rather than their variants.
Lemmatization
Lemmatization is another important data cleaning process that serves to reduce words to their base form or “lemma”. Unlike stemming, which reduces words to a generic root, lemmatization returns the correct and meaningful form of the word, often by consulting a linguistic dictionary.
To better understand how lemmatization works, let’s consider the following example:
Text after stemming: “city launch awar campaign for the environment environment educ.”

Text after lemmatization: “city launch awar campaign for the environment environment education.”
After lemmatization, “launched” becomes “launch”, and “environmental” becomes “environment”. This process ensures that all word variants are unified under a common and grammatically correct form, facilitating a more precise and consistent text analysis.



