Skip to content

Commit

Permalink
fix example_to_document() / document_to_example(): use "attributions"…
Browse files Browse the repository at this point in the history
… to access the attributes because the base dataset loader still produces this
  • Loading branch information
ArneBinder committed Nov 7, 2023
1 parent 55d3791 commit 4a9c871
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dataset_builders/pie/brat/brat.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def example_to_document(

attribute_annotations: Dict[str, Dict[str, Attribute]] = defaultdict(dict)
attribute_ids = []
for attribute_dict in dl2ld(example["attributes"]):
for attribute_dict in dl2ld(example["attributions"]):
target_id = attribute_dict["target"]
if target_id in spans:
target_layer_name = "spans"
Expand Down Expand Up @@ -264,7 +264,7 @@ def document_to_example(
)
attribute_dicts[attribute_annotation] = attribute_dict

example["attributes"] = ld2dl(
example["attributions"] = ld2dl(
list(attribute_dicts.values()), keys=["id", "type", "target", "value"]
)
example["normalizations"] = ld2dl(
Expand Down

0 comments on commit 4a9c871

Please sign in to comment.