View additional fields in the interface.

Hi all, how can I add additional fields to the annotation interface for reference (help lookup the raw text from the source files)? I think adding those fields would help with the "machine teaching" process.

So if I add an additional field to the jsonl rows (add "id":"2233aab" ) for example with the label and text fields how can I render that in the UI? I have been looking at the customization sections, but it still isn't clear. I believe by adding a few more fields to the display it would really add some additional value to the process.

Hi! That's definitely possible :slightly_smiling_face: If you just want to display short meta information like an id value, the easiest way would be to add it under a key "meta" in the JSON. All meta information will be displayed in the bottom right corner of the annotation card automatically.

If you want to display more custom content, you can also use blocks to combine different interfaces – for example, you could have a text block that shows the raw "text", followed by a HTML block that shows a link, the ID, or any other information you have.

For example, if your content looks like this:

{"text": "This is a text", "id": 1234}

... your blocks coud look like this:

html_template = """<a href="https://example.com/{id}">ID: {id}</a>"""
blocks = [{"view_id": "text"}, {"view_id": "html", "html_template": html_template}]

You can also edit an existing recipe like ner.manual and make it use blocks instead of just a single UI – e.g. an ner_manual block, followed by a html block. Also see this example of a fully custom recipe with blocks: https://prodi.gy/docs/custom-recipes#example-blocks