HumanSignal / label-studio

Label Studio is a multi-type data labeling and annotation tool with standardized output format
https://labelstud.io
Apache License 2.0
18.89k stars 2.35k forks source link

meta fields are lost after importing #1179

Closed lluissalord closed 3 years ago

lluissalord commented 3 years ago

Describe the bug We are importing our tasks using pre-annotated data and we are including some metadata on meta field which is a dictionary with two string values. On the original file we have this meta field with data, but after importing if we export or look on the Target Storage we see that the meta field is empty.

To Reproduce Steps to reproduce the behavior:

  1. Import JSON task/s with some data in meta field
  2. Export data as JSON file

Expected behavior There should appear the metadata information on the exported file

Environment (please complete the following information):

makseq commented 3 years ago

@lluissalord Where do you place meta ? In a task or in a prediction? I recommend to put meta in a task.data:

{
 data: {
  meta: { ... }
 }, 
 predictions: [{...}]
}
lluissalord commented 3 years ago

@makseq I place the meta at task level as it is specified on the API https://labelstud.io/api#tag/Tasks

{
 data: {
   text: "",
 }, 
 predictions: [{...}]
 meta: { ... }
}

I understand that inside task.data will work because that field is intent to remain, however I would recommend to fix the issue or modify the API in order to not confuse.

makseq commented 3 years ago

@lluissalord Thank you for your feedback, I hope we remove it soon from the task model.

makseq commented 3 years ago

@lluissalord Just checked this issue, in the latest master the export json file contains meta field with all subfields. However, we will remove meta from task in the future.

https://github.com/heartexlabs/label-studio/pull/1307