The main goal of preprocessing text data, is so that we can convert it into a vector for machine learning models to be able to process it.
Here are 5 key reasons why we use preprocessing:
- Noise Reduction
- removing special characters, punctuations, irrelevant infomation for cleaning of data
- Tokenization
- break texts into tokens (words/subwords), used in transformer architecture
- Normalization
- standardize words (lowercase, stemming, lemmatiation) for reduced vocabulary size
- Stop Word Removal
- eliminate common words
- Handling of OOV words
- replace out-of-vocabulary (OOV) words with unknown tokens
- Sentence Segmentation
- seperate text into sentences for individual analysis
- Feature Engineering
- extract linguistic features (n-grams, POS tags) to enhance understanding
There are 3 main ways we can preprocess textual data.
All these are performed for Vectorization
Order matters as much as the choice of step, and the safe order is set out in Pipeline.