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

Pre-annotations of TextArea missing #3941

Closed
michaelachmann opened this issue Mar 31, 2023 · 1 comment
Closed

Pre-annotations of TextArea missing #3941

michaelachmann opened this issue Mar 31, 2023 · 1 comment
Assignees
Labels
import preannotations Issues using pre-annotated data problem bug or something isn't working

Comments

@michaelachmann
Copy link

Describe the bug
I'm trying to transcribe audio files. When uploading tasks with pre-annotations using the Python SDK (API), the annotations are not displayed in the interface.

Maybe a duplicate of #3093

To Reproduce

  1. Create a new project and Interface:
interface = """
<View>
  <Audio name="audio" value="$audio" zoom="true" hotkey="ctrl+enter" />
  <Header value="Provide Transcription" />
  <TextArea name="transcript" toName="audio"
            rows="5" editable="true" maxSubmissions="1" />
</View>
"""

project_name = "Audio Project" 

ls = Client(url=labelstudio_url, api_key=labelstudio_key)
project = ls.start_project(
    title=project_name,
    label_config=interface,
)
  1. Upload Tasks with pre-annotations
project.import_tasks(
        df_tasks.to_dict('records'),
        preannotated_from_fields=['transcript'])
  1. Start the annotation: Pre-Annotations are missing in the interface (but present in the task files):
"predictions": [
    {
      "id": 28489,
      "model_version": "undefined",
      "created_ago": "1 hour, 22 minutes",
      "result": [
        {
          "type": "textarea",
          "value": {
            "textarea": [
              "... transcription ..."
            ]
          },
          "to_name": "audio",
          "from_name": "transcript"
        }
      ],
      "score": null,
      "cluster": null,
      "neighbors": null,
      "mislabeling": 0,
      "created_at": "2023-03-31T11:32:38.613079Z",
      "updated_at": "2023-03-31T11:32:38.613085Z",
      "task": 43936
    }
]

Expected behavior
The pre annotations should be display in the textarea.

Environment (please complete the following information):
Tested with different versions on Ubuntu with Docker Compose:

  • LS Version 1.4.1
  • LS Version 1.5.0
  • LS Enterprise 2.4.6dev
@makseq makseq added problem bug or something isn't working preannotations Issues using pre-annotated data import labels Apr 6, 2023
@hlomzik
Copy link
Collaborator

hlomzik commented Apr 6, 2023

Hey! For TextArea there should be text key in value instead of textarea:

"value": {
  "text": [
    "... transcription ..."
  ]
},

That's not clear from our documentation, thanks, we'll fix it soon!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
import preannotations Issues using pre-annotated data problem bug or something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants