label-studio-frontend
label-studio-frontend copied to clipboard
Label missing from UI when labels from different `Labels` tags are applied to the same text span
My problem was stated in the issue title.
Steps to reproduce
- 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>
- Upload a sample text and navigate to the corresponding task.
- Click on the
Person
label, and then select an arbitrary text span. - Click on the text span that we just highlighted to select it.
- 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.
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
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