generating spans for tagged entities on the server side