A team is building a spam filter from raw email text. Which preprocessing combination is most appropriate as an early NLP step?
Select an answer to reveal the explanation.
Short Explanation and Infographic
Spam is a text problem first. You split the email into tokens—words or subwords—and often drop stop words like "the" and "is" that rarely help a classic bag-of-words spam model. Think of it like cleaning a noisy inbox transcript before scoring it. Exam trap: semantic segmentation, resizing images, color filters—that's CV gear someone dragged into an NLP question. Don't take the bait. For email spam prep, talk tokens and stop words (plus lowercasing and the usual cleanup). Land that takeaway and you'll sail past these distractors.
Full explanation below image
Full Explanation
Email spam detection is a classic natural language processing classification setting. Raw messages must be converted into features a model can use. Tokenization splits text into words, subwords, or other units depending on the pipeline. Removing stop words—frequent function words that often carry little class-specific signal in simple models—reduces dimensionality and noise for many traditional representations such as bag-of-words or TF-IDF. Together, tokenization and stop-word removal are standard, exam-friendly preprocessing steps for this NLP task, often joined by lowercasing, URL or header normalization, HTML stripping, and rare-token handling. Those steps turn messy email strings into a cleaner token stream before vectorization or model input.
Semantic segmentation does not apply: it assigns class labels to pixels in images, which is a computer-vision dense prediction problem unrelated to reading subject lines and bodies. Resizing images may appear if the system also analyzes screenshots or embedded graphics in a multimodal detector, but it is not the crucial text-side preprocessing for the email body and subject that define classic spam NLP questions. Photographic color filters are likewise vision operations with no role in preparing textual tokens or bag-of-words features.
Modern systems may keep stop words when using contextual embeddings, because transformers can exploit function words, and they may tokenize with SentencePiece or byte-pair encoding rather than simple whitespace splits. Nonetheless, when a question contrasts sensible NLP prep against computer-vision operations, the correct selection is the text pipeline centered on tokens and optional stop-word filtering. Best practice also includes careful handling of adversarial spam, multilingual content, class imbalance, and privacy when storing messages. For memory: spam filter text path means tokenize and often drop stop words; pixel maps, resizes, and color filters stay in the vision toolkit. That separation of domains is frequently tested and should be automatic under time pressure.