rbiswasfc nbroad commited on
Commit
7b1516b
·
verified ·
1 Parent(s): 58d467f

Fix two labels back to back (#1)

Browse files

- Fix two labels back to back (6ad1fb0decbd4711d897e29b6419b60591c5060f)


Co-authored-by: Nicholas Broad <[email protected]>

Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -86,7 +86,7 @@ def render_sample(subset, pii_type):
86
  for index, label in enumerate(sample['labels']):
87
  if label.startswith('B-'):
88
  if in_entity: # End the previous entity
89
- ents.append(Span(doc, start, end, label[2:]))
90
  start, end = index, index + 1 # Start a new entity
91
  in_entity = True
92
  elif label.startswith('I-') and in_entity:
 
86
  for index, label in enumerate(sample['labels']):
87
  if label.startswith('B-'):
88
  if in_entity: # End the previous entity
89
+ ents.append(Span(doc, start, end, sample['labels'][start][2:]))
90
  start, end = index, index + 1 # Start a new entity
91
  in_entity = True
92
  elif label.startswith('I-') and in_entity: