Highlight certain character strings to improve ease of labelling.

I have some text such as

CA125 had a sensitivity of @METRIC$%, a specificity of @METRIC$%, and a diagnostic accuracy of 83.7% for @DISEASE$; CA19.9 had a sensitivity of 35.6%, a specificity of 81.1%...

I would like to add background highlighting to the @...$ so as to make the labelling easier, however I do not need to keep track of where they are or anything.

One way I thought of was enclosing the tag in

<mark style="background-color: #59f68d;">@DISEASE$</mark>

however the tag is simply printed as text. If it was allowed to print the text as html then this would work.

Hi! Which annotation interface are you using – are you annotating for text classification, NER or something else?

If you provide HTML via the "text", it's expected that it'll be rendered as plain text – the goal is to show you exactly what any model may see and what's in the data. Otherwise it'd be unclear what you're actually annotating. Interfaces like classification or choice can also read from a key "html" in the data, so you can provide your HTML like this.

For text-based tasks, you can also easily take advantage of the built-in highlighting, which will work in the ner/ner_manual interfaces, as well as classification or choice. If you're using regular expressions or something else to extract those strings from your text, you'll already have the start and end character, so you can just adds "spans" to your data like this:

{
    "text": "CA125 had a sensitivity of @METRIC$%",
    "spans": [{"start": 27, "end": 36, "text": "@METRIC$%"}]
}