Editing rel.manual to allow for multiple passes to account for nested entities

I am trying to make a custom recipe based off rel.manual to annotate relations between entities. I have some entities nested within other entities that I want to access, but only the outermost/longest entity appears in the annotation interface when using rel.manual, hence the need for the custom recipe.

I found this thread which suggests writing a stream generator to repeatedly send out the same example until I accept it, so I would be making multiple passes over the same data. I think this is what I want to do, since I can "delete" the longer outer entity and then the inner entity will be accessible on the annotation interface during the next pass.

My question is, how would I do this? I looked into pipeline components but that doesn't seem applicable at all.

Thanks for your time.

hi @rgandhasri87!

Thanks for your post and welcome to the Prodigy community :wave:

Did you also see this post?

It's a more recent post that provides some background on approaching this problem.

Alternatively, are you aware of spancat? It was designed (in part) to handle nested/overlapping entities as NER cannot.

This post provides some background on ways to combine spancat with relations:

Hope this helps provide more direction and let us know if you have further questions!