annotating entities with overlapping spans and their relations


It seems like there's no recipe for annotating relations among entities with overlapping spans, but my project requires that both entities with overlapping spans and their relations be annotated.

I've been using rel.manual recipe to do NER and relations tagging, but it doesn't allow annotating entities with overlapping span.

So I tried using spans.manual first to annotate entities with overlapping spans and then using rel.manual to annotate relations, but it didn't work either (when I tried annotating with rel.manual on the output annotated with spans.manual, all the entities with overlapping spans were gone, except for the longest one).

So my question is, is there a way to annotate both entities with overlapping spans and their relations with prodigy?

Thanks in advance for your help!

Hi there!

At the moment we don't support this, but I would like to understand your use-case a bit better. Could you explain your task a bit more? What's the main reason normal entities won't cut it?

If I understand the task better I might also be able to help with your current setup.

Also, I found this earlier thread on the forum that might be relevant:

Hi! Thanks for the reply.

Our task is to annotate span named entities, their relations, and events in legal wills.

There are cases where we need to annotate entities with overlapping spans and their relations and/or events involving them, as shown in the screenshot below:

We'd like to annotate relations among entities (e.g., coreference resolution, testator-executor, testator-asset, etc.) and events (e.g., "direction" event, involving arguments I (testator), direct (trigger), Executor (executor), pay all my just debts and all funeral expenses (duty)). These relations and events often involve entities with overlapping spans, so we wanted to figure out a way to deal with such situations.

I'd greatly appreciate any suggestions on how to deal with such cases. Thanks once again for your help with this matter!

This sure seems relevant! I'll check out the thread. Thanks!

Just from eye-balling this, it seems like your co-reference task doens't require every entity, right? Only a subset seems relevant. It might be an idea to only consider a subset of the spans for entity extraction and another subset for span detection.

A follow up question: what is the final task of the model? Why do you need the coferences?