Any resources to help me hack the UI for NER labelling?

Things I'd like to accomplish -

1.) Show additional fields like ID on the UI during annotation so that I can track it down later for further analysis when I come across text that isn't getting tokenized properly or has any other issues.

2.)Filter out texts from even showing up for annotations if the number of tokens in the sentences is less than 3 or some condition like that.

Thanks!

Hi @thalish,

There are ways to customize the annotation UI for your recipe. In fact there are a number of threads about it that already exist on the forum. If you search for "Custom UI" you'll find them.

Here's one on customizing the NER interface: Customizing ner.teach recipe + annotation UI

For this, you wouldn't need to modify anything in the UI – the data is streamed in by a regular Python generator and that lets you control how to stream in data and whether to send out an example for annotation. So you could add a filter like this and apply it at the end of your recipe after your texts are tokenized:

def filter_stream(stream):
    for eg in stream:
        if len(eg["tokens"]) > 3:
            yield eg

The easiest way to add meta information that's shown during annotation would be to use a task's "meta" field. This is what's displayed in the bottom right corner of the annotation card.