NCA-GENL Question 37
Select 2You are building a generative AI application that requires extracting entities from text and representing them as numerical vectors to perform similarity searches in a vector database. Which combination of Python packages would be most suitable for this task?
- A
spaCy for entity extraction and NumPy for creating numerical vectors
- B
spaCy for entity extraction and a vector database like FAISS for similarity search
- C
NumPy for entity extraction and spaCy for creating numerical vectors
- D
FAISS for entity extraction and NumPy for similarity search
- E
spaCy for entity extraction and FAISS for storing and querying vectors
Show answer and explanation
Correct answers: B, E
Explanation
The correct combination involves using spaCy for entity extraction from text and FAISS as a vector database for similarity search. SpaCy is optimized for natural language processing tasks, such as named entity recognition, while FAISS is designed to efficiently store and query high-dimensional vectors. NumPy is useful for numerical operations but is not specialized for entity extraction or vector database tasks.
- A. Incorrect.
While spaCy is suitable for entity extraction, NumPy is not specifically designed for handling similarity searches or serving as a vector database. It focuses on numerical computation and array manipulation.
- B. Correct.
This is correct. SpaCy is highly efficient for entity extraction, and FAISS is a specialized library for storing and querying vectors, making it suitable for similarity search tasks.
- C. Incorrect.
NumPy is not designed for entity extraction or natural language processing tasks, making this option incorrect. SpaCy, on the other hand, excels at these tasks.
- D. Incorrect.
FAISS is not designed for entity extraction, and NumPy is not optimized for similarity searches, so this combination is incorrect.
- E. Correct.
This is correct. SpaCy can perform entity extraction from text, and FAISS is a robust vector database for storing and querying numerical representations of text.