Spaces:
Sleeping
Sleeping
cindyangelira
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -22,8 +22,9 @@ def get_colors():
|
|
22 |
def process_prediction(text, pred):
|
23 |
colors = get_colors()
|
24 |
|
25 |
-
|
26 |
-
|
|
|
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 |
|