Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -125,10 +125,10 @@ if text_input:
|
|
| 125 |
}
|
| 126 |
|
| 127 |
# Replace each entity in the text with its annotated version
|
| 128 |
-
|
| 129 |
-
|
| 130 |
-
|
| 131 |
-
|
| 132 |
entity_type = entity_data.get("@type", None)
|
| 133 |
|
| 134 |
# Use different colors based on the entity's type
|
|
|
|
| 125 |
}
|
| 126 |
|
| 127 |
# Replace each entity in the text with its annotated version
|
| 128 |
+
for entity_string, entity_info in entities_map.items():
|
| 129 |
+
entity_data = entities_data.get(entity_string, None)
|
| 130 |
+
entity_type = None
|
| 131 |
+
if entity_data is not None:
|
| 132 |
entity_type = entity_data.get("@type", None)
|
| 133 |
|
| 134 |
# Use different colors based on the entity's type
|