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

Inconsistent completions - NER HTML tagging

Open hipek8 opened this issue 4 years ago • 3 comments

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: Zrzut ekranu 2021-01-29 o 11 57 12

Note: different start/end index and different offset.

hipek8 avatar Jan 29 '21 11:01 hipek8

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.

image


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"
    }
]

g-simmons avatar Mar 08 '21 21:03 g-simmons

Relative: https://github.com/heartexlabs/label-studio/issues/778 https://github.com/heartexlabs/label-studio/issues/1164

makseq avatar Aug 10 '21 09:08 makseq

@hipek8 @g-simmons Hope it's fixed in the latest master branch.

makseq avatar Aug 11 '21 00:08 makseq