Training pipeline for a relation extraction system