Label-studio: Cannot export pre-annotated tasks

Created on 6 May 2021  路  6Comments  路  Source: heartexlabs/label-studio

Describe the bug
I used the API to import already annotated data in Basic Label Studio JSON format. It worked well as the results are actually showing on each task and they are marked as annotated. When I try to export this tasks (through API or UI), I get an empty list.
I tried to import only the data through API and annotate a few tasks through the UI, and the annotated tasks did showed up on the export. I then tried to update the annotation after importing pre-annotated tasks, but the export still fails.

To Reproduce
Steps to reproduce the behavior:

  1. Import annotated data throught the API
    Ex payload I used :
    {"data": {"sentence": "SoftBank-backed OneWeb files for Chapter 11 bankruptcy plan, cuts jobs", "metadata": {}}, "annotations": [{"ground_truth": false, "result": [{"value": {"choices": ["Neutral"]}, "from_name": "sentiment", "to_name": "sentence", "type": "choices"}]}], "predictions": []}

Label config :

<View>
  <Text name="sentence" value="$sentence"/>
  <View style="box-shadow: 2px 2px 5px #999; padding: 20px; margin-top: 2em; border-radius: 5px;">
    <Header value="Choose text sentiment"/>
    <Choices name="sentiment" toName="sentence" choice="single" showInLine="true">
      <Choice value="Positive"/>
      <Choice value="Negative"/>
      <Choice value="Neutral"/>
    </Choices>
  </View>
</View>
  1. Export data throught API or UI, results in empty data

Expected behavior
Pre-annotated tasks showing up in the export.

Environment (please complete the following information):

  • OS: linux
  • Label Studio Version == 1.0.1
  • Postgres DB in Docker

Thanks !

bug

Most helpful comment

@Lauler @rizziemma Thank you for your report. This is a bug and it happens because the is_labeled statistic wasn't re-calculated after import. I'll hope we'll fix it soon.

All 6 comments

If anyone gets stuck on the same problem, I found the parameter "download_all_tasks" in the source code as I was trying to fix this.
I write it here as I didn't find anything in the docs, so adding "download_all_tasks = true" to my GET requests works as a little workaround for this issue.

I have the exact same issue when trying to import pre-annotated tasks as finished "annotations".

It is possible to import them as "predictions" and then manually submit every prediction via the UI. This was my workaround. However, I think expected behavior should be that pre-annotated tasks (under the "annotations" key) show up in the export.

Exact same environment as @rizziemma

@Lauler @rizziemma Thank you for your report. This is a bug and it happens because the is_labeled statistic wasn't re-calculated after import. I'll hope we'll fix it soon.

Same issue here

@deneland @Lauler @rizziemma https://github.com/heartexlabs/label-studio/pull/978 - could you check this branch please? I hope it's fixed now.

I'm very sorry for the delay I don't know why I wasn't notified by your response :( I will try it soon thanks for working on it !

Was this page helpful?
0 / 5 - 0 ratings