I em extending the 101 on text classification, using this example to add custom key mappings;
Custom keyboard shortcuts for labels NEW: 1.9.4
I am trying to map labels to single keys by creating prodigy.json
as follows:
{
"keymap": {
"accept": ["o", "a"],
"reject": ["k", "x"],
"save": ["command+space"]
},
"keymap_by_label": {"Technology":"1","Politics":"2","Economy":"3","Entertainment":"4"}
}
and then running
prodigy textcat.manual news_topics ./news_headlines.jsonl --label Technology,Politics,Economy,Entertainment
but in the web interface, pressing 1/2/3/4 do not result in any of my classification labels being selected.
If I do something similar using the ner.manual
recipe instead i can choose my NER tag using 1/2/3/4, but is there any reason why I cant do this with text-classication labels?
For some reason, if I use
"keymap_by_label": {"Technology":"t","Politics":"p","Economy":"e","Entertainment":"a"}
instead, then in the UI, if I press 1/2/3/4 then appropriate category is selected, but pressing t
does not result in "technology" being selected. This behaviour is not observed for ner.manual
.
I am getting the behaviour I want, but the documentation is a bit confusing.