NCA-GENL Question 66
Select 4You are tasked with creating a Named Entity Recognition (NER) model to identify entities such as 'Person', 'Organization', and 'Location' in text data. Using Python, you decide to use spaCy for this task. What is the correct sequence of steps to implement and train a custom NER model using spaCy?
- A
Load a pre-trained spaCy model and add a new 'ner' pipeline component to it.
- B
Prepare and annotate your training data in the spaCy-supported JSON format.
- C
Use NumPy to manually compute gradient updates for the NER model during training.
- D
Call the
begin_training()method for the pipeline and train the model using your annotated data. - E
Export the trained NER model to a Keras-compatible format for deployment.
- F
Test the trained NER model on unseen data to evaluate performance.
Show answer and explanation
Correct answers: A, B, D, F
Explanation
To build and train a custom NER model in spaCy, the workflow involves loading a pre-trained model, adding an NER pipeline, preparing annotated training data, training the model using begin_training(), and finally evaluating its performance on unseen data. NumPy and Keras, while useful in other contexts, are not part of the standard spaCy pipeline for NER tasks.
- A. Correct.
Correct: Adding a new 'ner' pipeline component to a pre-trained spaCy model is the first step in customizing and training an NER model.
- B. Correct.
Correct: Preparing and annotating your training data in a spaCy-compatible format (like JSON) is essential for training a custom NER model.
- C. Incorrect.
Incorrect: NumPy is not used for manually computing gradients in spaCy. The training process is abstracted and handled internally by spaCy.
- D. Correct.
Correct: Calling the
begin_training()method is a crucial step to initialize and train the spaCy pipeline using your data. - E. Incorrect.
Incorrect: While Keras is powerful for deep learning applications, exporting a spaCy NER model to a Keras-compatible format is not typical or necessary for deployment.
- F. Correct.
Correct: Testing the trained model on unseen data is a critical step to evaluate its accuracy and generalization performance.