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

[FR] control tag to mimic HTML `<select>` behavior

Open addisonklinke opened this issue 3 years ago • 2 comments

Is your feature request related to a problem? Please describe.

It's not uncommon for classification labels to have 100s or more options for certain tasks. In this case, the annotator UI is much more concise and readable if the options are placed in a dropdown menu. I've looked through the documentation of available control tags, and am disappointed that this setup doesn't appear to exist

Describe the solution you'd like

Add a Select control tag which users could use in their labeling setup templates as an alternative to Choices

<Select name="gender" toName="text" choice="single">
  <Choice value="Man" />
  <Choice value="Woman" />
  <Choice value="Nonbinary" />
  <Choice value="Other" />
</Select>

Ideally, the HTML rendering would also have the option to use Bootstrap-select's live search feature. This would further decrease annotator lead time by allow them to tab to the select element, type a couple characters to filter the results, and use arrow keys + enter to select the desired option

Describe alternatives you've considered

  1. Existing Choices tag: this shows all options at once which makes for a very cluttered labeling UI when there are many choices
  2. Wrapping Choices with Filter: as documented by @Grzegorz Żurek in Slack, the filter input doesn't respond to annotators typing but rather continues to display the entire list of choices. In this way, it is no better than the plain Choices approach. The same non-responsive behavior is also mentioned here
  3. Wrapping with Taxonomy: this is the closest to the desired behavior. One problem is there are always "Add" and "Add inside" buttons which allows annotators to define their own option. In many classification tasks, that would need to be disabled so it forces them to pick from the existing options. Community members have also mentioned the JSON export is a bit messy, so I'm hesistant to use this control tag. If allowAdd was included as a parameter to Taxonomy and the JSON export could be simplified for non-nested taxonomies, I think that would be an acceptable solution

Additional context

A third question in Slack asking about this functionality

addisonklinke avatar Sep 07 '22 03:09 addisonklinke

Another shortcoming of Taxonomy is that it doesn't support a perRegion parameter like Choices. That means it can only apply a global classification to an entire image or piece of text (as opposed to a bounding box or word)

addisonklinke avatar Sep 08 '22 01:09 addisonklinke

@makseq How do you feel about re-naming this to focus on improvements to Taxonomy vs. creating a new Select control tag - perhaps that's easier to maintain? In either case, the desired tag needs to support

  1. Searchable dropdown list
  2. Tag parameter to enable/disable adding options
  3. Support for perRegion

addisonklinke avatar Sep 09 '22 16:09 addisonklinke

I agree with @addisonklinke, this would be a nice feature, especially the support for perRegion.

In addition, Taxonomy allows a user to add new labels, which seems is currently not supported by Labels or Choices. This would be useful for extreme multi-label (classification) tasks (related: #3846).

e-tornike avatar Mar 15 '23 11:03 e-tornike