How to return relations in text annotation service

45 views
Skip to first unread message

Josep SF

unread,
May 29, 2018, 12:20:22 PM5/29/18
to brat-users
Hi all,

I'm working on a tool to automatically annotate texts for a very specific domain, and I would like to integrate my tool into brat to use it as an automatic annotator.

Browsing from older posts I've been able to learn that brat in order to do this, one should define a webservice that receives the text as a string in a request and returns a JSON structure describing the annotations. From what I could learn by reading the code under the tools/ subfolder (e.g. tokenservice.py or randomtaggerservice.py), the expected json structure should be an array like:

[{"type": "some_type",
  "offsets": [["25", "31"]],
  "text": "the text between characters 25 and 31"}
 ...]

However, this structure only works for Text-bound annotations, and I would like to automatically return Relationships as well. What is the correct syntax for returning relations?

Is this json format documented anywhere? I couldn't find it.

Thank you for your time!


Goran Topic

unread,
May 30, 2018, 11:27:37 PM5/30/18
to brat-...@googlegroups.com
Unfortunately, I don't think this is implemented for anything but spans.
One alternative is to generate the .ann files directly, offline.

Sorry for the bad news.

Goran
> --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "brat-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to brat-users+...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages