MLS-C01 Question 73
Select 3You are working on an e-commerce dataset to build a recommendation system. The dataset contains customer reviews, but some reviews have missing values, corrupt characters, and stop words. Which of the following steps should you take to properly handle and preprocess this data for your machine learning model?
- A
Replace missing values with mean or median values of the dataset.
- B
Remove corrupt characters from the text data using a data cleaning library or script.
- C
Use a Natural Language Processing (NLP) library to remove stop words from the text corpus.
- D
Impute missing text reviews using a placeholder such as 'No Review'.
- E
Keep stop words intact to preserve the grammatical structure of the sentences.
Show answer and explanation
Correct answers: B, C, D
Explanation
Cleaning and preprocessing text data involves handling missing values, removing corrupt data, and reducing noise (e.g., stop words). Removing corrupt characters ensures valid data, while removing stop words focuses the model on meaningful content. Using placeholders for missing text ensures the dataset remains complete and usable by ML algorithms. Replacing missing values with mean or median is not applicable for text data, and keeping stop words unnecessarily increases noise in the dataset.
- A. Incorrect.
Replacing missing values with mean or median is appropriate for numerical data, not for text data like customer reviews.
- B. Correct.
Removing corrupt characters is an essential step in cleaning text data and ensures that only valid information is processed.
- C. Correct.
Removing stop words is a common preprocessing step in NLP to reduce noise and focus on meaningful words in the text data.
- D. Correct.
Imputing missing text reviews with a placeholder like 'No Review' ensures the dataset is consistent and avoids introducing null values into the model.
- E. Incorrect.
Keeping stop words intact is usually not recommended in NLP preprocessing because they do not contribute significantly to the model's understanding of the text.