webanno icon indicating copy to clipboard operation
webanno copied to clipboard

Export / Import Annotations to / from Brat Format

Open hterhors opened this issue 8 years ago β€’ 5 comments

Is there currently a way to export annotations in to the standard Brat-file format as described here http://brat.nlplab.org/standoff.html?

This would be a nice feature. Same for import documents from Brat-format.

Greetings, Hendrik

hterhors avatar Sep 01 '16 09:09 hterhors

The import/export for brat is not entirely trivial. But you can try doing a conversion outside of WebAnno. When you do that, you will notice why it is not trivial. But that said, it may still work for you.

  • Export the files as XMI
  • Build a DKPro Core pipeline that reads the XMIs and uses the BratWriter to export to brat format

If you want, I can send you an example of a brat->XMI pipeline I had set up for one user who wanted to import brat into WebAnno.

Presently, I don't have a ready XMI->brat example - but it should be easy to do because the BratWriter in DKPro Core is quite good at auto-detecting the type system and exporting it.

reckart avatar Sep 01 '16 10:09 reckart

Thanks for fast response,

I think I'll try to do it on my own first. If it does not work I will ask you for an example pipeline.

Thanks

hterhors avatar Sep 01 '16 11:09 hterhors

Is there any update on this. I currently have some files annotated in Brat I would like to import to WebAnno to do an inter-agreement check, and then continue tagging on WebAnno. I could manually re-tag inside WebAnno since it's not that much annotated yet, but it would be very nice to be able to automatically import the .ann files.

apiad avatar Feb 02 '18 09:02 apiad

The schema specification in brat is very different from the one in WebAnno. It can often be mapped, but this is a task that needs to be done manually. As it happens, I was just looking into such a case anyway.

Here is a gist for the moment. I hope to refine this and eventually add it to some proper documentation.

https://gist.github.com/reckart/306b8ffddd30bee1f3afd0468a9ad31d

reckart avatar Feb 02 '18 10:02 reckart

Standoff is a nice format! πŸ‘

jloveric avatar Jun 13 '18 19:06 jloveric

  • https://github.com/inception-project/inception/issues/4498
  • https://github.com/inception-project/inception/issues/2424

reckart avatar Apr 10 '24 21:04 reckart