Converting model predictions to .ann files

93 views
Skip to first unread message

Serena Lotreck

unread,
Jun 30, 2021, 2:07:32 PM6/30/21
to brat-users
Hi,

I'm trying to convert the output of an entity and relation extraction model to the brat standoff format in order to visualize the output. It's not a widely used format, so I've coded something up myself, which of course is not working very well. When I try and load the files I've made in brat, I get a ton of different errors. Some of them are clear to me what's going wrong in my own code, but others are totally cryptic. Namely, there are two that I'm hoping to get some clarification on here.

1. Error: verify_annotation() failed: 'UnparsedIdedAnnotation' object has no attribute 'type'

This error is particularly frustrating because it doesn't tell me what annotation has the problem -- and also because all of my annotations *do* have types in the .ann file. I don't understand what this error is trying to tell me.

2. ERROR
Trigger for event "T9" not found in undefined
(please correct the source data)

I am particularly confused by this because (1) there are no events (with the ID beginning with E) in my dataset and (2) there are no events in my annotation.conf file. I thought I was following the standoff format specifications exactly when I made my files, and the T9 in question is formatted as such:

T9      ENTITY 919 924    napin

where the larger spaces are \t characters. I don't understand why brat wants to interpret this as an event, nor what I have to do to fix it and have this be interpreted as an entity.

Any help is appreciated.
Thanks,
Serena

Serena Lotreck

unread,
Jul 2, 2021, 2:26:32 PM7/2/21
to brat-users
Answering my own question for posterity:

All of these cryptic errors went away once I fixed my character offsets -- there was a silent bug in my code that meant that the character offsets didn't align with the text they were supposed to. I'm not sure if you'd ever see these errors on their own, without some kind of underlying error in the character offsets, but in this case, fixing the character offsets fixed everything!
Reply all
Reply to author
Forward
0 new messages