NCA-GENL Question 39
Select 2You are tasked with building a simple text classification pipeline to categorize customer feedback into 'Positive', 'Negative', or 'Neutral'. Which combination of Python libraries would be most appropriate to preprocess the text, build embeddings, and store vectorized representations for efficient querying?
- A
spaCy for text preprocessing, NumPy for vector operations, and a vector database like FAISS for storing embeddings
- B
Matplotlib for data visualization, pandas for text preprocessing, and a relational database for storing embeddings
- C
spaCy for text preprocessing, transformers for generating embeddings, and a vector database like FAISS for storing embeddings
- D
NumPy for text preprocessing, scikit-learn for generating embeddings, and spaCy for storing embeddings
- E
pandas for text preprocessing, NumPy for embeddings, and a vector database like Redis for querying
Show answer and explanation
Correct answers: A, C
Explanation
Building a text classification pipeline involves multiple steps: preprocessing text data, generating embeddings, and storing/querying these embeddings efficiently. spaCy is a robust library for preprocessing tasks, while transformers can generate high-quality embeddings. For efficient querying of vectorized data, specialized vector databases like FAISS are highly suitable. Combining these tools appropriately ensures an efficient and high-performing pipeline.
- A. Correct.
Correct: spaCy is highly efficient for text preprocessing (e.g., tokenization, lemmatization), NumPy is ideal for operations on embeddings, and vector databases such as FAISS are optimized for storing and querying vectorized data.
- B. Incorrect.
Incorrect: Matplotlib is primarily used for data visualization, and relational databases are not optimized for querying high-dimensional vector data.
- C. Correct.
Correct: spaCy is useful for preprocessing, transformers can generate high-quality embeddings, and FAISS is a powerful tool for storing and querying vectorized data.
- D. Incorrect.
Incorrect: NumPy is not designed for preprocessing raw text data, and spaCy is not a database or storage solution for vectorized data.
- E. Incorrect.
Incorrect: While pandas is useful for tabular data manipulation, it is not ideal for text preprocessing. NumPy is not used for generating embeddings, and Redis is not specifically designed for vectorized queries without additional setups like RedisVector.