If the process should continue, i.e., stop is false, loss is defined as where score s r is the score of the question paired with the gold relation r in the next hop and sr is the score of the question paired with the extracted relationr.
if the process should terminate, we optimize the model by The model thus learns to infer sr is greater than s r , resulting in the termination of relation extraction.