You cannot — not with the model alone. It gives you spans + types, not identity.
You need to do that part yourself after the model runs. The filter gives you spans;
for each one, assign a stable ID (PERSON_1, PERSON_2) and keep
{PERSON_1: "Harry", PERSON_2: "Ron"} next to the document. Swap IDs in
before the LLM call, swap originals back in the reply.
Scoping that map to a document/project keeps the same person consistent
across calls, so Harry stays PERSON_1 instead of becoming PERSON_3 the
next time he's mentioned.
(Disclosure: I'm building a Mac privacy tool, RedMatiq, that does exactly this.
The mapping layer turned out substantially harder than detection.)
You need to do that part yourself after the model runs. The filter gives you spans; for each one, assign a stable ID (PERSON_1, PERSON_2) and keep {PERSON_1: "Harry", PERSON_2: "Ron"} next to the document. Swap IDs in before the LLM call, swap originals back in the reply.
Scoping that map to a document/project keeps the same person consistent across calls, so Harry stays PERSON_1 instead of becoming PERSON_3 the next time he's mentioned.
(Disclosure: I'm building a Mac privacy tool, RedMatiq, that does exactly this. The mapping layer turned out substantially harder than detection.)