# Training a relation extraction component

**URL:** <https://support.prodi.gy/t/training-a-relation-extraction-component/6376>\
**Category:** Uncategorized\
**Tags:** solved, relations, training\
**Created:** [February 20, 2023, 10:19am UTC](https://support.prodi.gy/t/training-a-relation-extraction-component/6376 "2023-02-20T10:19:15Z")\
**Posts on this page:** 1\
**Showing post:** 22

<div class="post-metadata">

**Author:** ![ryanwesslen](https://sea2.discourse-cdn.com/flex020/user_avatar/support.prodi.gy/ryanwesslen/32/2969_2.png) [@ryanwesslen](https://support.prodi.gy/u/ryanwesslen)\
**Post date:** [March 16, 2023, 11:44am UTC](https://support.prodi.gy/t/training-a-relation-extraction-component/6376/22 "2023-03-16T11:44:56Z")

</div>

> [@stella](#):
>
> I forgot, but there is still the issue related to loading a trained model :
> 
> ```python
> ValueError: [E002] Can't find factory for 'relation_extractor' for language English (en). This usually happens when spaCy calls `nlp.create_pipe` with a custom component name that's not registered on the current language class. If you're using a Transformer, make sure to install 'spacy-transformers'. If you're using a custom component, make sure you've added the decorator `@Language.component` (for function components) or `@Language.factory` (for class components).
> 
> Available factories: attribute_ruler, tok2vec, merge_noun_chunks, merge_entities, merge_subtokens, token_splitter, doc_cleaner, parser, beam_parser, lemmatizer, trainable_lemmatizer, entity_linker, ner, beam_ner, entity_ruler, tagger, morphologizer, senter, sentencizer, textcat, spancat, spancat_singlelabel, future_entity_ruler, span_ruler, textcat_multilabel, en.lemmatizer
> 
> ```

As per the error, it sounds like you may not be passing the tutorial’s config that creates this component.

Are you running your command [like](https://github.com/explosion/projects/blob/ab30f61bebe7b39100243c82c28932dc89a008ea/tutorials/rel_component/project.yml#L53) the tutorial does:

```python
python -m spacy train configs/rel_tok2vec.cfg --output training --paths.train train.spacy --paths.dev dev.spacy -c ./scripts/custom_functions.py

```

---

_[View the full topic](https://support.prodi.gy/t/training-a-relation-extraction-component/6376)._
