label-studio-frontend
label-studio-frontend copied to clipboard
Inconsistent completions - NER HTML tagging
Exported completions are different depending on order of selection. Tested on labelstudio.io/playground/ With config
<View>
<HyperTextLabels name="ner" toName="text">
<Label value="Person" background="green"/>
<Label value="Organization" background="blue"/>
</HyperTextLabels>
<View style="border: 1px solid #CCC;
border-radius: 10px;
padding: 5px">
<HyperText name="text" value="$text"/>
</View>
</View>
I tagged the same regions with the same labels but in different order.
These are the results:

Note: different start/end index and different offset.
Another example from the playground > HTML NER Tagging below. It looks like creating an annotation updates the DOM, and further annotations on the same HTML tag are with respect to this updated DOM.

Output preview
[
{
"value": {
"start": "/div[1]/div[1]/div[1]/p[1]/text()[1]",
"end": "/div[1]/div[1]/div[1]/p[1]/text()[1]",
"startOffset": 2,
"endOffset": 4,
"text": "No",
"htmllabels": [
"Person"
]
},
"id": "Y_g00erjMS",
"from_name": "ner",
"to_name": "text",
"type": "hypertextlabels"
},
{
"value": {
"start": "/div[1]/div[1]/div[1]/p[1]/text()[2]",
"end": "/div[1]/div[1]/div[1]/p[1]/text()[2]",
"startOffset": 1,
"endOffset": 3,
"text": "no",
"htmllabels": [
"Person"
]
},
"id": "n2zCeAS99-",
"from_name": "ner",
"to_name": "text",
"type": "hypertextlabels"
}
]
Relative: https://github.com/heartexlabs/label-studio/issues/778 https://github.com/heartexlabs/label-studio/issues/1164
@hipek8 @g-simmons Hope it's fixed in the latest master branch.