Prodigy hashing behavior

Hi @ale,

No problem - always happy to help :wink:

Responding inline:

Can you share a snippet to remove these number key shortcuts?

I just double checked and removing the key shortcuts from the UI is just a part of the solution. You still have to remap the numerical key shortcuts because they will apply even though the options are not visible.
This post describes how to go about remapping the default key shortcuts:

Then, if do choose to remove the visualization of the shortcuts from the UI as well (shouldn't be necessary, though if you do the remapping), here's the custom css snippet:

div.prodigy-option > span {
    display: none;
}

You can pass it as a string directly to the global_css setting in prodigy.json or save it in a file (e.g. custom.css), read it from the recipe:

custom_css = Path("custom.css").read_text()

and pass it as global_css in the recipe return statement e.g.:

 return {
        "dataset": dataset,
        "view_id": "blocks",
        "stream": stream,
        "config": {
            "labels": ["LABEL"],
            "blocks": blocks,
            "choice_style": "single",
            "global_css": custom_css
        }
    }

Specifically, I want to keep the HTML title above the choice block and add another HTML above the relations block with the same text that will be displayed in relations (but rendered in plain HTML).

That should be possible by specifying two html blocks each with a different value. The title above the choice block could just contain the rawhtmlvalue (it's a static text which would be the same for all tasks) and the other html block would display the text of the relations task via the html_template. Templates have access to the task dictionary and you can use dot notation to access nested keys:

blocks = [
        {"view_id": "html", "html": "<p>This is a fixed html</p>"},
        {"view_id": "choice", "text": None},
        {"view_id": "html", "html_template":"{{text}}"},
        {"view_id": "relations"}
    ]
1 Like