Unfortunately, this is a little trickier, because the text styling etc. is defined in the global styles of the annotation card. You could work around this with a custom recipe and a HTML template or HTML tasks, but this would also mean you’d have to create the entity spans manually from the data, and it wouldn’t look as nice or be more work, because you’d have to take care of the styling yourself.
I’ve been thinking about adding a style option to the annotation card (and possibly other parts of the app) that’d let you specify any custom CSS overrides. So you’d be able to do something like
"card_style": "text-align: left; font-weight: bold" etc. This feature has been on the roadmap for a while, but I wanted to wait and see if people actually wanted/needed something like this before making the app more complex by implementing it. But considering this has come up now, I’m happy to add it for the next release
The best solution that gives you maximum control would probably be to remove this line from the
recipes/ner.py, or to replace it with your own logic:
# Split the stream into sentences
stream = split_sentences(model.orig_nlp, stream)
split_sentences pre-processor splits the incoming text tasks into individual sentences, using the model’s sentence boundary detector. If you remove this step, you can control the surrounding context by passing it in as the
"text" of the annotation task. Prodigy would then render whatever comes in, without splitting or modifying it.