NCA-GENL Question 61
Select 4You are tasked with building a text classification model to classify customer support tickets into categories such as 'Billing', 'Technical Issue', and 'General Inquiry'. You decide to preprocess the text data using spaCy for tokenization and feature extraction, followed by using NumPy to prepare the data for input into a traditional machine learning algorithm. Which of the following steps should you take to complete this implementation?
- A
Use spaCy to tokenize the text and remove stop words.
- B
Use spaCy to generate word embeddings for the text data.
- C
Convert the preprocessed text data into a NumPy array of numerical features.
- D
Directly use the spaCy processed text as input to the traditional machine learning model.
- E
Split the NumPy array of features into training and test sets before model training.
Show answer and explanation
Correct answers: A, B, C, E
Explanation
To successfully implement a traditional machine learning analysis for text classification, the text must be preprocessed appropriately. spaCy provides tools for tokenization, stop word removal, and word embedding generation, which are essential for converting text into numerical features. NumPy can then be used to structure these features into arrays for use in machine learning models, and data must be split into training and test sets to evaluate model performance. Directly using spaCy objects without numerical conversion is not compatible with traditional machine learning frameworks.
- A. Correct.
Correct: Tokenization and stop word removal are common preprocessing steps for text data, especially for traditional machine learning models.
- B. Correct.
Correct: Word embeddings generated by spaCy can be used to represent text data numerically, which is required for machine learning models.
- C. Correct.
Correct: Converting the preprocessed text data into a structured numerical format, like a NumPy array, is necessary for compatibility with traditional machine learning algorithms.
- D. Incorrect.
Incorrect: Traditional machine learning models cannot directly process spaCy objects. The text must first be converted into numerical features.
- E. Correct.
Correct: Splitting the data into training and test sets ensures the performance of the model can be evaluated accurately on unseen data.