DexterSptizu commited on
Commit
4c072f6
1 Parent(s): 8c4e0aa

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -37,7 +37,11 @@ def classify_text(text):
37
 
38
  # Add highlighted entity text with the entity name displayed
39
  color = entity_colors.get(entity, "#e0e0e0") # Default to gray if entity type not defined
40
- highlighted_text += f"<span style='background-color:{color}; padding:2px; border-radius:5px; position:relative;'><strong>{word}</strong> <small style='color:#000; background-color: #fff; padding: 2px 4px; border-radius: 3px; position: absolute; top: -25px; left: 0;'>{entity}</small></span>"
 
 
 
 
41
 
42
  # Update last position
43
  last_pos = end
 
37
 
38
  # Add highlighted entity text with the entity name displayed
39
  color = entity_colors.get(entity, "#e0e0e0") # Default to gray if entity type not defined
40
+ highlighted_text += f"""
41
+ <span style='background-color:{color}; padding:2px; border-radius:5px;'>
42
+ {word}
43
+ <span style='display:inline-block; background-color:#fff; color:#000; border-radius:3px; padding:2px; margin-left:5px; font-size:10px;'>{entity}</span>
44
+ </span>"""
45
 
46
  # Update last position
47
  last_pos = end