I am trying to fine-tune ViLT model for visual question and answering using this notebook. In my dataset, I have introduced some new labels and was wondering how can I add new label.
Referring code
for answer in answer_count:
if answer not in list(config.label2id.keys()):
continue
labels.append(config.label2id[answer])
score = get_score(answer_count[answer])
scores.append(score)
In this code if answer is not found it just skip the or otherwise I face “KeyError”. What is the right way to introduce label in the model config. Please advise.