Spaces:
Running
Running
Update personal_info_identifier.py
Browse files
personal_info_identifier.py
CHANGED
@@ -20,7 +20,7 @@ def highlight_pii(text):
|
|
20 |
label = entity['entity_group']
|
21 |
|
22 |
# wrap entity with a span tag with color (red for demo, can be better)
|
23 |
-
span = f'<span style=" padding:2px 4px; border-radius:4px;">{text[entity["start"]:entity["end"]]} <b style="color:red;">[{label}]</b></span>'
|
24 |
highlighted_text = highlighted_text[:start] + span + highlighted_text[end:]
|
25 |
offset += len(span) - (end - start)
|
26 |
|
|
|
20 |
label = entity['entity_group']
|
21 |
|
22 |
# wrap entity with a span tag with color (red for demo, can be better)
|
23 |
+
span = f'<span style="background-color:#ffcccc; padding:2px 4px; border-radius:4px;">{text[entity["start"]:entity["end"]]} <b style="color:red;">[{label}]</b></span>'
|
24 |
highlighted_text = highlighted_text[:start] + span + highlighted_text[end:]
|
25 |
offset += len(span) - (end - start)
|
26 |
|