Feature extraction
At this stage, we have only a raw text representing reviews, which is not sufficient to run any machine learning algorithm. We need to transform the text into a numeric format, aka perform the so-called "feature extraction" (it is as it sounds; we are taking the input data and extracting features which we will use to train a model). The method generates some new features based on input feature(s). There are many methods regarding how the text can be transformed into numeric features. We can count the number of words, length of text, or number of punctuations. However, to represent text in a systematic way that would reflect a text structure, we need more elaborate methods.
Feature extraction method– bag-of-words model
Now that we have ingested our data and created our labels, it's time to extract our features to build our binary classification model. As its name suggests, the bag-of-words approach is a very common feature-extraction technique whereby we take a piece of text...