How to add "incorrect_spans" feature into pretrained spacy model #9088
-
Hi Team, Currently, I am using the pre-trained spacy model "en_core_web_lg" for NER prediction. There are some words for which model is giving the wrong prediction like - "TestData" being predicted as "Person". I wanted to use the latest feature("incorrect_spans") of spacy but I am confused about how to do that. As per documentation,
But when I am doing it, I am getting an error as "ner is already added in pipe", which seems reasonable but then how to update ner config file. Can anyone help here? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
Hi, I'm afraid this process is not as smooth yet as we would like (and we definitely want to address this in the future). If I understand your use-case correctly, you want to fine-tune an existing NER model. That means you don't want to use
This will pull in the trained NER component from the other pipeline into your new pipeline. Now, unfortunately the currently pretrained pipelines (e.g. `en_core_web_lg 3.1.0) have this setting by default:
and there is currently no way yet to change it. We will implement this in the future. For now, a kind-of-silly workaround is to either edit your
Once that's done, you can |
Beta Was this translation helpful? Give feedback.
Hi,
I'm afraid this process is not as smooth yet as we would like (and we definitely want to address this in the future).
If I understand your use-case correctly, you want to fine-tune an existing NER model. That means you don't want to use
add_pipe
, because that will create a blank model from scratch. Instead, you want to create a new pipeline with your required components by creating a config file that sources the relevant components:This will pull in the trained NER component from the other pipeline into your new pipeline.
Now, unfortunately the currently pretrained pipelines (e.g. `en_core_web_lg 3.1.0) have this setting …