[NAACL'21 Demo] EventPlus: a temporal event understanding pipeline that integrates various state-of-the-art event understanding components including event trigger and type detection, event argument detection, event duration and temporal relation extraction
During inference, if a sentence does not produce probabilities > 0.5 for any candidate event, the TempRelAPI.pred() pipeline breaks.
Specifically if the below line in construct_relations() returns an empty list, the TempRel pipeline breaks at a downstream line
# select event based on prob > 0.5, but eliminate ent_pred > context length
ent_locs = [[x for x in (ent_probs[b,:, 1] > 0.5).nonzero().view(-1).tolist()
if x < lengths[b]] for b in range(batch_size)]
If ent_locs is an empty list, TempRel EventEvaluator.evaluate() call breaks at:
predicted_rels = [self.model._id_to_label[ridx] for ridx in torch.argmax(preds, dim=1).tolist()]
Also, NNClassifier.predict() doesn't like when probs returns as an empty list, either, which it definitely does return as an empty list if the ent_locs in construct_relations is an empty list, as rel_idxs returns as an empty list, etc:
During inference, if a sentence does not produce probabilities > 0.5 for any candidate event, the
TempRelAPI.pred()
pipeline breaks.Specifically if the below line in
construct_relations()
returns an empty list, the TempRel pipeline breaks at a downstream lineIf ent_locs is an empty list, TempRel
EventEvaluator.evaluate()
call breaks at:Also,
NNClassifier.predict()
doesn't like whenprobs
returns as an empty list, either, which it definitely does return as an empty list if theent_locs
in construct_relations is an empty list, asrel_idxs
returns as an empty list, etc: