SAS DLPy provides the TextClassification class for NLP tasks. When fine-tuning a pre-trained BERT model for sentiment analysis using SAS DLPy, which pre-processing step is required before feeding text to BERT?
Select an answer to reveal the explanation.
Short Explanation
Here's the deal — you need to tokenize input text with BERT's WordPiece tokenizer and convert it into token IDs, attention masks, and segment IDs. BERT expects those subword token inputs, not raw text or classical text-mining vectors.
Full Explanation
The correct pre-processing step is tokenizing input text using BERT's WordPiece tokenizer and converting it to token IDs, attention masks, and segment IDs. This tokenization is fundamental to BERT's architecture: token IDs feed the model's embedding layers, attention masks distinguish real tokens from padding, and segment IDs support sentence-pair tasks. The TF-IDF vector option is wrong because BERT operates on token sequences, not TF-IDF sparse vectors. The stemming and stop word removal option is wrong because BERT uses subword tokenization, not classical stemming or stop word removal. The character-level one-hot encoding option is wrong because character-level one-hot encoding is not BERT's input format.