Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

If a document is uploaded with an existing annotation_sets field. New annotations should be appended to this field rather than overwritten. #348

Open
twinkarma opened this issue Apr 21, 2023 · 0 comments
Assignees

Comments

@twinkarma
Copy link
Collaborator

twinkarma commented Apr 21, 2023

Users can upload documents that have existing annotations either from other Teamware projects or from other GATE tools.

When exporting the document after it's been annotated on Teamware, new annotations should be appended to the annotation_sets field rather than overwritten.

For example, a user uploads this document:

{
  "id": 32,
  "text": "Document text",
  "text2": "Document text 2",
  "feature1": "Feature text",
  "annotation_sets":{
    "user1":{
       "name":"user1",
       "annotations":[
          {
             "type":"Document",
             "start":0,
             "end":10,
             "id":0,
             "features":{
                "sentiment": "positive"
                
             }
          }
       ],
       "next_annid":1
    }
  }
}

And an annotation has been made by user2 on our system with sentiment negative, this should be the output when exporting:

{
   "id":32,
   "text":"Document text",
   "text2":"Document text 2",
   "feature1":"Feature text",
   "annotation_sets":{
      "user1":{
         "name":"user1",
         "annotations":[
            {
               "type":"Document",
               "start":0,
               "end":10,
               "id":0,
               "features":{
                  "sentiment":"positive"
               }
            }
         ],
         "next_annid":1
      },
      "user2":{
         "name":"user2",
         "annotations":[
            {
               "type":"Document",
               "start":0,
               "end":10,
               "id":0,
               "features":{
                  "sentiment":"negative"
               }
            }
         ],
         "next_annid":1
      }
   }
}

If the user name/id of the annotator already exists in the document, should the annotation be overwritten or would you just append it to the list of their annotations e.g.

{
   "id":32,
   "text":"Document text",
   "text2":"Document text 2",
   "feature1":"Feature text",
   "annotation_sets":{
      "user1":{
         "name":"user1", 
         "annotations":[
            {
               "type":"Document",
               "start":0,
               "end":10,
               "id":0,
               "features":{
                  "sentiment":"positive"
               }
            },
            {
               "type":"Document",
               "start":0,
               "end":10,
               "id":0,
               "features":{
                  "sentiment":"negative"
               }
            }
         ],
         "next_annid":1
      },
    
   }
}

and if so, what if there's an id conflict like the above example?

@twinkarma twinkarma changed the title If a document is uploaded with an existing annotation_sets field. Annotations to be appended to this field rather than overwriiten. If a document is uploaded with an existing annotation_sets field. New annotations should be appended to this field rather than overwriiten. Apr 21, 2023
@twinkarma twinkarma changed the title If a document is uploaded with an existing annotation_sets field. New annotations should be appended to this field rather than overwriiten. If a document is uploaded with an existing annotation_sets field. New annotations should be appended to this field rather than overwritten. Apr 21, 2023
@twinkarma twinkarma self-assigned this May 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant