Skip to content

Adding relations to time-series task with <Text valueType="url"> - e._spans is undefined #1026

Closed
@sethidden

Description

@sethidden

Describe the bug
I have a problem when using the Relation Extraction template AND using <Text ... valueType="url"> (time series data). Adding a single relation, then submitting the task, and trying to open it again results in:

Uncaught (in promise) TypeError: can't access property 0, e._spans is undefined

To Reproduce
Steps to reproduce the behavior:

  1. Create a new project
  2. Set the templae to this:
<View>
  <Relations>
    <Relation value="org:founded_by"/>
    <Relation value="org:founded"/>
  </Relations>
  <Labels name="label" toName="text">
    <Label value="Organization" background="orange"/>
    <Label value="Person" background="green"/>
    <Label value="Datetime" background="blue"/>
  </Labels>
  <Text name="text" value="$text" valueType="url"/>
</View>
<!-- {"data": { "text": "Microsoft was founded by Bill Gates and Paul Allen on April 4, 1975, to develop and sell BASIC interpreters for the Altair 8800." }, "completions": [{"result": [ { "value": { "start": 0, "end": 9, "text": "Microsoft", "labels": [ "Organization" ] }, "id": "a-ubmF-dP2", "from_name": "label", "to_name": "text", "type": "labels" }, { "value": { "start": 25, "end": 35, "text": "Bill Gates", "labels": [ "Person" ] }, "id": "dQ_pmsrWsm", "from_name": "label", "to_name": "text", "type": "labels" }, { "value": { "start": 40, "end": 50, "text": "Paul Allen", "labels": [ "Person" ] }, "id": "IpmpOMj0vw", "from_name": "label", "to_name": "text", "type": "labels" }, { "value": { "start": 54, "end": 67, "text": "April 4, 1975", "labels": [ "Datetime" ] }, "id": "Q-zXcdacte", "from_name": "label", "to_name": "text", "type": "labels" }, { "from_id": "a-ubmF-dP2", "to_id": "dQ_pmsrWsm", "type": "relation", "direction": "right", "labels": [ "org:founded_by" ] }, { "from_id": "a-ubmF-dP2", "to_id": "IpmpOMj0vw", "type": "relation", "direction": "right", "labels": [] }, { "from_id": "a-ubmF-dP2", "to_id": "Q-zXcdacte", "type": "relation", "direction": "right", "labels": [ "org:founded" ] } ] }]
} -->
  1. Import a .txt file for labelling as time series
  2. Enter the .txt file in task view
  3. Annotate two entities and submit (in top right) - at this point everything is still ok - I can re-enter the tasks view for this task just fine
  4. Enter the task again, click an annotation, press "r" (to enter relationship mode) and click on the other annotation to create a relation
  5. Click "Update" in top right
  6. The window will reload, but you won't be able to see the task view anymore. You'll get console errors like (I'm on Firefox, in Chrome the wording is a bit different):
Uncaught (in promise) TypeError: can't access property 0, e._spans is undefined

Expected behavior
It should be possible to add relations to time series, where Text has valueType=url

Screenshots

  1. This is the state after you complete step 5 from the reproduction: (where everything is still ok)
    image

  2. This is the state from step 6 from the reproduction:
    Right now, if I press "Update" in top right, I won't be able to see the task view anymore (after the view reloads)
    image

  3. This is after doing step 7 from the repro
    image

Environment (please complete the following information):

  • OS:
    • label-studio is hosted on Debian 10, using Docker
    • I access it from my Arch Linux laptop with Firefox (but the error also happens on Chromium)
  • Label Studio Version [1.0.2]

Additional context
When you already have a "broken" task, if you:

  1. export it to json
  2. manually remove all the "results" objects where "type: "relation""
  3. re-import it again

It'll be possible to open the task again (so "revert the task" to the state from step 5 in the reproduction)

Metadata

Metadata

Assignees

Labels

problembug or something isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions