Spaces:
Sleeping
Sleeping
DexterSptizu
commited on
Commit
•
4c072f6
1
Parent(s):
8c4e0aa
Update app.py
Browse files
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"
|
|
|
|
|
|
|
|
|
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
|