Ability to load annotations into the INITIAL_CAS via remote API
Is your feature request related to a problem? Please describe. It can be useful to start an annotation project with a bunch of pre-annotated documents. However, depending on the document format, it is very difficult to impossible to prepare pre-annotated documents. In particular there is currently no way to import a pre-annotated PDF file.
Describe the solution you'd like The idea would be to:
- import a PDF via the remote API
- export the document as XMI via the remote API
- add pre-annotations to this XMI externally
- load this XMI back into INCEpTION as the INITIAL_CAS for the document
Describe alternatives you've considered Not sure what good alternatives could be.
I recently started using PDF annotation feature for the first time. I've been curious how to do PDF preannotation, so I landed here. The work-around I've been doing is:
- export as xmi and xmi contains character indices
- modify xmi files programmatically to add annotations
- import the xmi (I need to rename from .xmi to .pdf to match the file name) for each user via remote API
This sort of does the trick, though if annotators happen to "reset" the document, then it would be back to blank, so, what is described here sounds great.
In addition to the comment above, I figured that if I import the xmi for one user for all preannotation via remote API, that user will have the CAS .ser file for all the preannotated documents.
Then, if full zip export is done (*edit: chose no secondary file format to have only .ser files), that unzip that and copy that user's .ser files as INITIAL_CAS.ser for each document. Then, re-zip and import that newly created zip file as INCEpTION project, and it does the job of having preannotated documents.
This is a work-around of course, but one way to achieve PDF preannotation for the time being.
Great you found a work-around for your case 👍
I think it would be a great feature, if the inceptioncan have a button to send request to a pre-annotation server (configurable ), then everything can be handled externally on that server. So all need is to make a RESTFul client and make it configuration able for inception. Any thoughts?
@jianlins so how would you imagine that to work from a user perspective? Like this?
- configure pre-annotation server in INCEpTION
- upload document
- press button next to the document in the project settings document list to trigger pre-annotation
- INCEpTION sends the CAS of the document to the server
- server returns a CAS with annotations to INCEpTION which is then stored as the INITIAL_CAS