HumanSignal / HumanSignal/label-studio

Use both valueType text and url in labeling interface

Open
#6,580 7 comments 0 reactions 0 assignees View on GitHub
community_investigate community_issue
Dominant language
TypeScript
Stars
28.3k
Forks
3.7k
Avg merge
14h
Merged PRs (30d)
15

Description

I'm trying to support both valueTypes for my labeling interface since I'm receiving tasks that can either be an s3 path to a text file, or just text. so my tasks will look like this:

```json
{
"data": {
"text_url": "s3://textfiles/file.txt"
}
}
```

Or this:

```json
{
"data": {
"text": "This is some inline text, do not worry"
}
}

```

Here is my labeling interface:

```xml







```

This works correctly for the `text_url` task files. But displays URL() not valid for `text` task files. Which means it doesn't find `text_url` field in my task.json and either passes an empty string or "None" or something like that and interprets it as a wrong URL.

Is it possible to either check for which field is present and go with that? Or just ignore text_url if it's not valid? Even though the second option will prevent me from seeing any relevant errors linked to a genuinely invalid URL.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.