ValueError: [E143] Labels for component 'relation_extractor' not initialized. This can be fixed by calling add_label, or by providing a representative batch of examples to the component's `initialize` method.
I run the same code on the data I prepared last year in a different annotation tool (UBIAI) and it works just fine, so I am certain there is something wrong with the data set here.
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, then reuse / modify this parse_data.py script 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. So you have to do something like:
If you're using your own dataset, you might need to adjust the parsing process. But a good first step would be to try this script out in your own exported JSONL files.