# Train recipe for parser: ValueError: Could not find gold transition

**URL:** <https://support.prodi.gy/t/train-recipe-for-parser-valueerror-could-not-find-gold-transition/4796>\
**Category:** Uncategorized\
**Tags:** enhancement, spacy, dep\
**Created:** [October 12, 2021, 3:51pm UTC](https://support.prodi.gy/t/train-recipe-for-parser-valueerror-could-not-find-gold-transition/4796 "2021-10-12T15:51:09Z")\
**Posts on this page:** 1\
**Showing post:** 6

<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:** [February 23, 2023, 12:34pm UTC](https://support.prodi.gy/t/train-recipe-for-parser-valueerror-could-not-find-gold-transition/4796/6 "2023-02-23T12:34:24Z")

</div>

hi @shakyawar.developer!

Sorry for the confusion, but if you simply annotated relations and entities with `rel.manual`, the problem is `data-to-spacy` doesn't work because spaCy's Doc object doesn't have built-in support for relations.

> [@prodigy data-to-spacy for relation extraction](https://support.prodi.gy/t/prodigy-data-to-spacy-for-relation-extraction/5620/2):
>
> At the time of writing, spaCy doesn't natively support relation extraction models. The example that we list on our docs [here](https://spacy.io/usage/layers-architectures#component-rel) is meant to be a tutorial on how to set up a custom component, not a guide on a feature in spaCy. The crux of the issue is that the Doc object in spaCy currently has no support for relationships. That is also why, in turn, the .spacy object does not support them. The config file that you see can be changed via the --config flag ([docs](https://prodi.gy/docs/recipes#data-to-spacy)). If this flag is not set, which is y…

I just posted a similar post where I tried to provide steps of how you can modify Sofie's relations extraction [video](https://www.youtube.com/watch?v=8HL-Ap5_Axo) and [code](https://github.com/explosion/projects/tree/v3/tutorials/rel_component) (be sure to watch segments where she describes the code):

> [@Training a relation extraction component](https://support.prodi.gy/t/training-a-relation-extraction-component/6376/4):
>
> Hi @stella! Yes, this is exactly the setup Sofie does. She explicitly says from the beginning she's going to assume she already has a trained ner component. Yes! Sofie used Thinc for training. You can see the training code [here](https://github.com/explosion/projects/blob/v3/tutorials/rel_component/scripts/rel_model.py) and she carefully explains the code in 8:11 to 18:30 the Thinc model script. She then describes around 22:55 an Overview of the TrainablePipe API and how to implement the custom component. You may not need to know all of the details and can luckily leverage a lot of t…

The key is you need to modify the `parse_data.py` script as mentioned here:

> [@data-to-spacy for rel\_component training](https://support.prodi.gy/t/data-to-spacy-for-rel-component-training/5852/4):
>
> Hi @korneliaB , Ok, let us step back for a bit. I realized that since you already have the labeled documents in Prodigy, you can export them into .jsonl using the [db-out command](https://prodi.gy/docs/recipes#db-out), then [reuse / modify this parse\_data.py script](https://github.com/explosion/projects/blob/v3/tutorials/rel_component/scripts/parse_data.py) to convert the JSONL files into the spaCy format. The reason why it errored out is because it expects some labels before the component is initialized. You can see this being done in the [main function](https://github.com/explosion/projects/blob/v3/tutorials/rel_component/scripts/parse_data.py#L22). So you have to do something like: python scripts.parse\_data path/to/js…

Hope this helps!

---

_[View the full topic](https://support.prodi.gy/t/train-recipe-for-parser-valueerror-could-not-find-gold-transition/4796)._
