Skip to content
Snippets Groups Projects
Commit b6ffc7b9 authored by Julien B.'s avatar Julien B.
Browse files

fix(inferer): fix missing var

parent ea48e913
No related branches found
No related tags found
No related merge requests found
...@@ -114,6 +114,13 @@ def inference_process(inference_data, model_id): ...@@ -114,6 +114,13 @@ def inference_process(inference_data, model_id):
attentions=outputs.attentions, attentions=outputs.attentions,
) )
tag2id = {'action': 1, 'actor': 2, 'artifact': 3, 'condition': 4, 'location': 5, 'modality': 6, 'reference': 7,
'time': 8}
label2id = {
'O': 0,
**{f'{k}': v for k, v in tag2id.items()}
}
id2label = {v: k for k, v in label2id.items()}
model = RobertaForSpanCategorization.from_pretrained(model_id) model = RobertaForSpanCategorization.from_pretrained(model_id)
tokenizer = AutoTokenizer.from_pretrained(model_id) tokenizer = AutoTokenizer.from_pretrained(model_id)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment