...

/

Updating an Existing Pipeline Component

Updating an Existing Pipeline Component

Let's see how we can further train spaCy's NER component.

We will now train spaCy's NER component further with our own examples to recognize the navigation domain. We already saw some examples of navigation domain utterances and how spaCy's NER model labeled entities of some example utterances:

navigate/0 to/0 my/0 home/0
navigate/0 to/0 Oxford/ORG Street/ORG

Obviously, we want NER to perform better and recognize location entities, such as street names, district names, and other location names, such as home, work, and office. Now, we'll feed our examples to the NER component and will do more training. We will train NER in three steps:

  1. First, we'll disable all the other statistical pipeline components, including the POS tagger and the dependency parser.

  2. We'll feed our domain examples to the training procedure.

  3. We'll evaluate the new NER model.

Also, we will learn how to do the following:

  • Save the updated NER model to disk.

  • Read the updated NER model when we want to use it.

Let's get started and dive into training the NER model procedure. As we pointed out in the preceding list, we'll train the NER model in several steps. We'll start with the first step, disabling the other statistical models of the spaCy NLP pipeline.

Disabling the other statistical models

Before starting the training procedure, we disable the other pipeline components, hence we train only the intended component. The following code segment disables all the pipeline components except NER. We call ... ...