Spaces:
Runtime error
Runtime error
Fix two labels back to back (#1)
Browse files- Fix two labels back to back (6ad1fb0decbd4711d897e29b6419b60591c5060f)
Co-authored-by: Nicholas Broad <nbroad@users.noreply.huggingface.co>
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,
|
| 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:
|