label-studio-frontend icon indicating copy to clipboard operation
label-studio-frontend copied to clipboard

Label missing from UI when labels from different `Labels` tags are applied to the same text span

Open minhduc0711 opened this issue 1 year ago • 1 comments

My problem was stated in the issue title.

Steps to reproduce

  1. Use the following UI template
    <View>
      <Labels name="category1" toName="text">
        <Label value="Person" background="red"/>
      </Labels>
    
       <Labels name="category2" toName="text">
        <Label value="Location" background="green"/>
      </Labels>
    
      <Text name="text" value="$text"/>
    </View>
    
  2. Upload a sample text and navigate to the corresponding task.
  3. Click on the Person label, and then select an arbitrary text span.
  4. Click on the text span that we just highlighted to select it.
  5. Click on the Location label to apply it to this text span as well.

Expected The text span is highlighted with both labels, and both of them are also displayed in the Outliner sidebar.

Actual Only Person is displayed everywhere, although Location is still registered. You can verify it by clicking on the text span to see both Person and Location light up, or export the project to see two annotations for the same text span.

image

Exported result

"result": [
    {
        "value": {
            "start": 14,
            "end": 330,
            "text": "lor sit amet, consectetur adipiscing elit. Proin ac accumsan est. Curabitur convallis volutpat ipsum pretium porta. In eu nibh nisi. Sed rutrum justo sit amet pharetra ullamcorper. Proin viverra ullamcorper sapien at molestie. In condimentum neque eget aliquam ornare. Maecenas scelerisque hendrerit turpis, et males",
            "labels": [
                "Person"
            ]
        },
        "id": "fct2n643xx",
        "from_name": "category1",
        "to_name": "text",
        "type": "labels",
        "origin": "manual"
    },
    {
        "value": {
            "start": 14,
            "end": 330,
            "text": "lor sit amet, consectetur adipiscing elit. Proin ac accumsan est. Curabitur convallis volutpat ipsum pretium porta. In eu nibh nisi. Sed rutrum justo sit amet pharetra ullamcorper. Proin viverra ullamcorper sapien at molestie. In condimentum neque eget aliquam ornare. Maecenas scelerisque hendrerit turpis, et males",
            "labels": [
                "Location"
            ]
        },
        "id": "fct2n643xx",
        "from_name": "category2",
        "to_name": "text",
        "type": "labels",
        "origin": "manual"
    }
],

Version Label Studio 1.7.1

minhduc0711 avatar Apr 04 '23 13:04 minhduc0711

Hey @minhduc0711, thanks for the report, I was able to reproduce this bug. I already created a ticket for fix this bug. Just for internal reference the ticket number is: LSDV-4937

juliosgarbi avatar Apr 11 '23 13:04 juliosgarbi