I'm making a customisable interface and want to include dropdowns for my span labels.
I've read all the discussions on the downsides of having too many labels but I'd like to rearrange my labels in a way which fits with our current annotation system.
Having tested the examples given on the documentation and given in previous discussions, I think (?) I'm not referencing the right internals.
I'm using spans to label my data but instead of using the span buttons, I would like to use a dropdown and hide the span labels.
Here's just a simple example of the span labels/html and css that mimics what I have in my recipe.
It seems that our documentation is missing a segment. If you look at the ner_manual interface you'll see that there is a configuration for a dropdown via the label_style parameter. This is also available for the spans_manual interface, but the docs are missing a segment.
When you use this in a custom recipe (or in a prodigy.json) then you'll be able to configure a dropdown. Here's an example with a custom recipe.
from prodigy.components.preprocess import add_tokens
from pathlib import Path
dataset=("Dataset to save answers to", "positional", None, str),
file_in=("Input file", "positional", None, Path),
def my_custom_recipe(dataset, file_in):
# Load your own streams from anywhere you want
stream = srsly.read_jsonl(file_in)
nlp = spacy.blank("en")
"stream": add_tokens(nlp, stream),
"labels": ["foo", "bar", "buz"],