Google Professional Machine Learning Engineer Question 73
Select 3Google Cloud PlatformYou are tasked with building a custom machine learning model to classify customer reviews into positive, neutral, or negative sentiments. Your dataset includes text reviews from customers, along with metadata such as the product name, review date, and customer ID. Which of the following steps should you take to best prepare the data for training your model?
- A
Preprocess the text data by removing stopwords, punctuation, and converting to lowercase.
- B
Use one-hot encoding for the product name and customer ID metadata.
- C
Apply text tokenization and convert the text data into numerical representations such as word embeddings.
- D
Drop all metadata columns since they are irrelevant for sentiment classification.
- E
Split the dataset into training, validation, and test sets.
Show answer and explanation
Correct answers: A, C, E
Explanation
To train a custom model for sentiment classification, the text data must first be preprocessed to remove unnecessary tokens and standardized (e.g., lowercase). The text must also be tokenized and converted into numerical representations (e.g., word embeddings, TF-IDF, etc.) for the model to process. Finally, the data must be split into training, validation, and test sets to ensure the model's performance is evaluated properly. While metadata could be explored for feature engineering, it is not a primary requirement in this scenario.
- A. Correct.
Preprocessing text data by removing stopwords, punctuation, and converting to lowercase is a common step to clean text for natural language processing tasks and improve model performance.
- B. Incorrect.
Using one-hot encoding for categorical metadata like product name and customer ID is not appropriate in this case, as these fields are unlikely to directly influence sentiment classification. Instead, the focus should be on the text of the reviews.
- C. Correct.
Converting text into numerical representations such as word embeddings is necessary for training machine learning models on text data, as models cannot process raw text directly.
- D. Incorrect.
Dropping metadata columns like product name and customer ID outright is not a recommended step, but their relevance should be evaluated. However, the core focus here is the text data for sentiment classification.
- E. Correct.
Splitting the dataset into training, validation, and test sets is a critical step to ensure the model generalizes well and avoids overfitting.