I'm wondering whether there's an easy way to change the styling or color of some tokens in the ner.manual
interface. I'm having annotators highlight certain entities within news articles, and I want to cue their attention to specific words in the text that match a dictionary of terms to make their work faster.
One approach could be to to add the styling directly to the tokens being passed in, similar to #254.
If the original example looks like this,
{"tokens": [{"text": "In", "start": 0, "end": 2, "id": 0},
{"text": "Mumbai", "start": 3, "end": 9, "id": 1},
{"text": ",", "start": 9, "end": 10, "id": 2},
{"text": "police", "start": 11, "end": 17, "id": 3},
{"text": "arrested", "start": 18, "end": 26, "id": 4},
...],
"text": "In Mumbai, police arrested protestors and fired teargas at activists."}
I'd like to be able to add something like a style
or color
key to the token dictionary:
{"text": "arrested", "start": 18, "end": 26, "id": 4, "style": "color:blue"},
and have the token's HTML within the interface change to
<span class="c01166" style="color:blue" id="4">arrested</span>
This would be pretty simple to do using the HTML interface, but that's not compatible with ner.manual
. Do you have suggestions for how I could do this? This might be too niche for a big change to Prodigy to be worth it, but it could be useful for other people who want something in between ner.teach
and ner.manual
.