IS361Group4 commited on
Commit
cdabd86
·
verified ·
1 Parent(s): 0305929

Update personal_info_identifier.py

Browse files
Files changed (1) hide show
  1. personal_info_identifier.py +1 -1
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