Skip to content

Commit

Permalink
Fix ground truth check bug 0329
Browse files Browse the repository at this point in the history
  • Loading branch information
BeyonderXX committed Mar 29, 2023
1 parent c9ba4e5 commit cb50be8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/uie_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,7 @@ def load_RE_dataset(self, dataset_path, labels_path, dataset_name, sampling_stra
ground_truth_pairs.append([relation['head']['name'], 'NA', relation['tail']['name']])
continue
relation_pair = [relation['head']['name'], relation['type'], relation['tail']['name']]
ground_truth_pairs.append(relation_pair)
relation_pairs.append(relation_pair)

if len(relation_pairs) > 0:
Expand All @@ -325,6 +326,7 @@ def load_RE_dataset(self, dataset_path, labels_path, dataset_name, sampling_stra
if len(ground_truth_pairs) > 0:
ground_truth = ", ".join(["({}, {}, {})".format(h, r, t) for (h, r, t) in ground_truth_pairs])
else:
logger.error("******Error item: {}******".format(instance))
raise Exception('Dataset Error:{}, No ground truth!'.format(dataset_name))

example["Instance"] = {
Expand Down

0 comments on commit cb50be8

Please sign in to comment.