We group the pseudo-documents in our database by the relation label that the instance pairs were given.
we end up with several bags of pseudo-documents, where each bag corresponds to a single relation type of interest.