Description
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:
- Create a new project
- 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" ] } ] }]
} -->
- Import a .txt file for labelling as time series
- Enter the .txt file in task view
- 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
- Enter the task again, click an annotation, press "r" (to enter relationship mode) and click on the other annotation to create a relation
- Click "Update" in top right
- 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
-
This is the state after you complete step 5 from the reproduction: (where everything is still ok)
-
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)
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:
- export it to json
- manually remove all the "results" objects where "type: "relation""
- 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)