mc0c0z commited on
Commit
414ce00
·
verified ·
1 Parent(s): 6ad4337

Fix misplaced token in ner task

Browse files
Files changed (1) hide show
  1. app.py +1 -0
app.py CHANGED
@@ -222,6 +222,7 @@ def ner_inference(model, tokenizer, text, device):
222
  # Decode the input ids to tokens
223
  tokens = tokenizer.convert_ids_to_tokens(input_ids[0], skip_special_tokens=True)
224
 
 
225
  # Combine tokens with their NER labels
226
  ner_tags = list(zip(tokens, labels))
227
 
 
222
  # Decode the input ids to tokens
223
  tokens = tokenizer.convert_ids_to_tokens(input_ids[0], skip_special_tokens=True)
224
 
225
+ labels = labels[1:-1]
226
  # Combine tokens with their NER labels
227
  ner_tags = list(zip(tokens, labels))
228