cindyangelira commited on
Commit
85e68e9
·
verified ·
1 Parent(s): c6d00dd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -22,8 +22,9 @@ def get_colors():
22
  def process_prediction(text, pred):
23
  colors = get_colors()
24
 
25
- for token in pred:
26
- token['label'] = token['entity'].replace('B-', '').replace('I-', '')
 
27
 
28
  ents = [{'start': token['start'], 'end': token['end'], 'label': token['label']} for token in pred]
29
 
 
22
  def process_prediction(text, pred):
23
  colors = get_colors()
24
 
25
+ # Correctly refer to 'label' instead of 'entity'
26
+ # for token in pred:
27
+ # token['label'] = token['label'].replace('B-', '').replace('I-', '')
28
 
29
  ents = [{'start': token['start'], 'end': token['end'], 'label': token['label']} for token in pred]
30