Nested Labels while using rel.manual

Hi! Prodigy's interfaces for NER (and the span annotation features within the relations UI) are set up to work best with the way named entity recognition models generally work: contiguous, non-overlapping spans, with clear beginnings and endings. If the relation annotation has to represent any number of nested spans with each span and token being potentially connected to each other, this easily gets very messy and inefficient, and there's usually a better way to structure the task that's both easier to annotate and easier to visualise.

In your case, it looks like you're mostly looking to highlight and connect text fragments and sections, right? For cases like this, we usually recommend making multiple passes over the data and focus on the different objectives: for example, extract the <DEF> blocks first, then collect more fine-grained annotations. When using the relations interface, it also makes sense to focus only on the spans that you actually want to connect.

How you structure the task also depends on what your model needs to predict later on. For example, it makes sense to predict boundary-sensitive spans that are more like named entities, e.g. person names, as token-based tags, whereas other labels maybe predicted as labels applying to a whole sentence or paragraph. This also influences how you structure the annotation.

Btw, not sure if this is relevant for your use case, but here's a thread on annotating relations between longer fragments in legal texts and possible and efficient annotation approaches: Using relations interface for large texts