Same words of a article tagged multiple times.

example

Hi Team,
I have a scenario like above image. Is there way I can tag the first entity '1.' before the first word("1.Germany") and '2.' before the second one in the displacy output.

hi @arda!

Thanks for your question!

Are you asking on how to do this for displaCy or in Prodigy? This forum is for Prodigy; however, you mentioned displaCy. I want to make sure I'm thinking of the right one :slight_smile:.

If it's displaCy, could you write a post-processing script with the counts and appends the count to the entity label? For entities I think displaCy will automatically render that label so adding the "1. ", "2. " for each appearance should work.

Alternatively, if your question is for Prodigy -- I suspect you may mean creating labels-on-the-fly (e.g., start with certain entity labels and then modify them like adding counts)?

Unfortunately if so, Prodigy wasn't designed for dynamic label sets (within the same session). Here's a great post on the Prodigy's "one-label-set-per-session" philosophy:

Let me know if either of these answer your question.