MLS-C01 Question 99
Select 3A data scientist is building a machine learning model to classify customer feedback as positive, negative, or neutral. The dataset consists of text comments from various sources, including social media and customer support tickets. Which of the following approaches are appropriate for identifying and extracting features from this dataset?
- A
Use Amazon Comprehend to extract sentiment and key phrases from the text data.
- B
Apply a Bag-of-Words or Term Frequency-Inverse Document Frequency (TF-IDF) technique to encode the text into numerical vectors.
- C
Use Amazon Rekognition to detect features in the text data.
- D
Train a custom convolutional neural network (CNN) on the text data directly.
- E
Leverage a pre-trained transformer-based model, such as AWS-supported Hugging Face models, to extract contextual embeddings.
Show answer and explanation
Correct answers: A, B, E
Explanation
When working with text data, feature extraction techniques should be tailored to natural language processing (NLP). Services like Amazon Comprehend and pre-trained transformer models are specifically designed for processing and extracting meaningful features from text. Additionally, traditional NLP techniques like Bag-of-Words or TF-IDF are still widely used for encoding text into numerical representations. However, tools like Amazon Rekognition are not applicable for text data, and CNNs are not suited for direct processing of text data.
- A. Correct.
Amazon Comprehend is an AWS service designed for natural language processing (NLP), which can extract sentiment and key phrases from text data, making it a valid feature extraction approach.
- B. Correct.
Bag-of-Words and Term Frequency-Inverse Document Frequency (TF-IDF) are common techniques in NLP for encoding text into numerical vectors that can be used as input features for machine learning models.
- C. Incorrect.
Amazon Rekognition is designed for image and video analysis, not for processing or extracting features from text data, so this is not a valid approach.
- D. Incorrect.
Convolutional neural networks (CNNs) are typically used for image data, not for text data. Directly training a CNN on text data would not be effective without significant transformations, making this option invalid.
- E. Correct.
Transformer-based models, such as those supported by AWS via Hugging Face, are state-of-the-art for NLP tasks. They can be used to generate contextual embeddings from text, which are rich features for machine learning models.