# Can't find component 'spancat' in pipeline.

**URL:** <https://support.prodi.gy/t/cant-find-component-spancat-in-pipeline/6254>\
**Category:** Uncategorized\
**Created:** [January 20, 2023, 1:35pm UTC](https://support.prodi.gy/t/cant-find-component-spancat-in-pipeline/6254 "2023-01-20T13:35:48Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mohammad](https://avatars.discourse-cdn.com/v4/letter/m/e274bd/32.png) [@Mohammad](https://support.prodi.gy/u/Mohammad)\
**Post date:** [January 20, 2023, 1:35pm UTC](https://support.prodi.gy/t/cant-find-component-spancat-in-pipeline/6254/1 "2023-01-20T13:35:48Z")

</div>

python3 -m prodigy spans.correct correctd\_DBCVDOBV1 ./CV\_DOBV1/model-best/ ./12.01.23\_100\_Cv\_Format.jsonl

✘ Can't find component 'spancat' in pipeline. Make sure that the  
pipeline you're using includes a trained span categorizer that you can correct.  
If your component has a different name, you can use the --component option to  
specify it.

Can you help how to resolve this issue

---

<div class="post-metadata">

**Author:** ![koaning](https://sea2.discourse-cdn.com/flex020/user_avatar/support.prodi.gy/koaning/32/230_2.png) [@koaning](https://support.prodi.gy/u/koaning)\
**Post date:** [January 20, 2023, 3:13pm UTC](https://support.prodi.gy/t/cant-find-component-spancat-in-pipeline/6254/2 "2023-01-20T15:13:46Z")

</div>

Just to check, how did you train your model? Did you train for a NER task? If so, that might explain why it doesn't have a spancat component.

Note that you can always check the components in your pipeline from Python. Here's the standard `en_core_web_sm` model and it's components:

```python
import spacy 

nlp = spacy.load("en_core_web_sm")
print(nlp.pipeline)

```

This yields:

```plaintext
[('tok2vec', <spacy.pipeline.tok2vec.Tok2Vec at 0x7fea5e251fa0>),
 ('tagger', <spacy.pipeline.tagger.Tagger at 0x7fea5e251ee0>),
 ('parser', <spacy.pipeline.dep_parser.DependencyParser at 0x7fea9610f2e0>),
 ('attribute_ruler',
  <spacy.pipeline.attributeruler.AttributeRuler at 0x7fea5e1e7140>),
 ('lemmatizer',
  <spacy.lang.en.lemmatizer.EnglishLemmatizer at 0x7fea5e1de140>),
 ('ner', <spacy.pipeline.ner.EntityRecognizer at 0x7fea9610f350>)]

```

Similarily you should also be able to load your own model and see the pipeline components via:

```python
nlp = spacy.load("path/to/model")
print(nlp.pipeline)

```

---

<div class="post-metadata">

**Author:** ![Mohammad](https://avatars.discourse-cdn.com/v4/letter/m/e274bd/32.png) [@Mohammad](https://support.prodi.gy/u/Mohammad)\
**Post date:** [January 23, 2023, 6:35am UTC](https://support.prodi.gy/t/cant-find-component-spancat-in-pipeline/6254/3 "2023-01-23T06:35:04Z")

</div>

I printed the pipeline and I got massage below :

[('tok2vec', \<spacy.pipeline.tok2vec.Tok2Vec object at 0x0000027FAA5EEB60\>), ('ner', \<spacy.pipeline.ner.EntityRecognizer object at 0x0000027FAA525310\>)]

---

<div class="post-metadata">

**Author:** ![koaning](https://sea2.discourse-cdn.com/flex020/user_avatar/support.prodi.gy/koaning/32/230_2.png) [@koaning](https://support.prodi.gy/u/koaning)\
**Post date:** [January 23, 2023, 10:03am UTC](https://support.prodi.gy/t/cant-find-component-spancat-in-pipeline/6254/4 "2023-01-23T10:03:01Z")

</div>

Then it seems like you've gotten a pretrained model that can detect named entities (NER) while your recipe is trying to predict spans, via `prodigy spans.correct`. That also explains the warning that you see because a spancat component is needed to predict spans.

To learn more about the difference between spancat and NER, you might appreciate this blogpost:

> **[Spancat: a new approach for span labeling · Explosion](https://explosion.ai/blog/spancat/)**
>
> The SpanCategorizer is a spaCy component that answers the NLP community's need to
> have structured annotation for a wide variety of labeled spans, including long
> phrases, non-named entities, or overlapping annotations. In this blog post, we're
> excited...

One of the main differences is that spancat can predict overlapping spans, which NER doesn't allow in spaCy. That means that you probably to train a model that can handle spans, which you can do via the [train command in Prodigy](https://prodi.gy/docs/recipes/#training). It will probably look something like:

```python
python -m prodigy train --spancat <datasets>

```

Alternatively, if you can solve your task with NER instead of spancat, you may also consider using the [ner.correct](https://prodi.gy/docs/recipes#ner-correct) recipe instead.
