A sentiment analysis model has low validation accuracy, and the data scientist suspects a very large vocabulary with low average word frequency is the issue. Which preprocessing or method would best improve validation accuracy?
Choose an answer
Tap an option to check your answer.
Correct answer: Convert text to TF-IDF feature vectors (for example, using scikit-learn's TfidfVectorizer)..
Why this is the answer
TF-IDF (Term Frequency-Inverse Document Frequency) is effective for handling large vocabularies with low average word frequency because it assigns higher weights to words that are frequent in a specific document but rare across the entire corpus. This helps to highlight important, distinguishing terms while downplaying common, less informative words, thereby improving the model's ability to learn meaningful patterns and increasing validation accuracy. Using Amazon Comprehend for syntax analysis and entity detection provides rich linguistic features but doesn't directly address the issue of a large, sparse vocabulary. BlazingText in CBOW mode generates word embeddings, which can help with semantic understanding but might still struggle with very rare words if not enough context is available. Stemming and stop word removal reduce vocabulary size but can also remove valuable information, especially for sentiment analysis where specific word forms or common words might carry sentiment.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed