HumanSignal / HumanSignal/label-studio

Add "required" field for tag results in exported data

Open
#6,036 3 comments 0 reactions 0 assignees View on GitHub
community:feature-request community:reviewed
Dominant language
TypeScript
Stars
28.3k
Forks
3.7k
Avg merge
14h
Merged PRs (30d)
15

Description

**Is your feature request related to a problem? Please describe.**
I use one template with different "required" settings of tags for different projects. This is designed to reduce the burden of tagging tasks and to give different emphasis each time. But when I analyze the results, I need to distinguish whether a certain tag is required or not, such as filtering the post processed results with elasticsearch.

**Describe the solution you'd like**
```txt
# FROM
"result": [
{
"value": {
"choices": [
"No"
]
},
"id": "8264eY7_8D",
"from_name": "_1003",
"to_name": "dialogue_html",
"type": "choices",
"origin": "manual"
},
...
]

# TO
"result": [
{
"value": {
"choices": [
"No"
]
},
"id": "8264eY7_8D",
"from_name": "_1003",
"to_name": "dialogue_html",
"type": "choices",
"origin": "manual",
"required": false // add this new field
},
...
]
```

**Describe alternatives you've considered**
I have considerd put the information into "from_name" for now, wihch is the name of a tag like `Choices`. For example when I generate the template for a new project, I might be able to:

```python
if item.get("required", False):
name = name + "_r" # r for required
else:
name = name + "_o" # o for optional
```

But such code with pre and post process looks very ...irregular. And what's more, old projects cannot add the information with updating the new generated template directly.

Consider more, "required" information is only one of many meta-information. Perhaps a more flexible string array of meta information could be used to augment such information?

**Additional context**
No

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.