ArneBinder / pie-datasets

Building scripts for Pytorch-IE datasets.
MIT License
1 stars 0 forks source link

update brat attribute layers #145

Open Bhuvanesh-Verma opened 3 months ago

Bhuvanesh-Verma commented 3 months ago

This PR adds a breaking change to the previous implementation of annotation attributes in BratDocument and BratDocumentWithMergedSpans. Previously, both of these documents had separate layers for span and relation attributes as span_attributes and relation_attributes respectively. With the new changes, the attributes are stored in each document's attribute layer, which targets spans and relations.

The following example shows how annotation attributes can be added:


span_attribute = BratAttribute(annotation=span, label="actual")
- doc.span_attributes.extend(span_attribute)
+ doc.attributes.append(span_attribute)
assert span_attribute.resolve() == (True, "actual", ("person", "Jane"))
codecov[bot] commented 3 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 92.23%. Comparing base (346cc25) to head (4bd61a1).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #145 +/- ## ========================================== + Coverage 91.81% 92.23% +0.42% ========================================== Files 10 10 Lines 855 850 -5 ========================================== - Hits 785 784 -1 + Misses 70 66 -4 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.