Spaces:
Sleeping
Sleeping
sotirios-slv
commited on
Commit
•
1654918
1
Parent(s):
5e10a9a
Cleaned up entity string for display
Browse files
app.py
CHANGED
@@ -23,12 +23,12 @@ def get_named_entities(ocr_text: str):
|
|
23 |
|
24 |
for token in sentence:
|
25 |
for entity in token.get_spans("ner"):
|
26 |
-
|
27 |
entities.append(entity)
|
28 |
|
29 |
-
|
30 |
-
# entities = "/n".join(entities)
|
31 |
|
|
|
32 |
return entities
|
33 |
|
34 |
|
|
|
23 |
|
24 |
for token in sentence:
|
25 |
for entity in token.get_spans("ner"):
|
26 |
+
entity = str(entity).split(":")[1]
|
27 |
entities.append(entity)
|
28 |
|
29 |
+
entities = "/n".join(entities)
|
|
|
30 |
|
31 |
+
print("ENTITIES ", entities)
|
32 |
return entities
|
33 |
|
34 |
|