Spaces:
Sleeping
Sleeping
Update main.py
Browse files
main.py
CHANGED
|
@@ -281,9 +281,13 @@ def entities_and_types(sentence):
|
|
| 281 |
def entities_and_types(sentence):
|
| 282 |
ner_output = extract(sentence)
|
| 283 |
print("RAW NER OUTPUT:", ner_output)
|
| 284 |
-
|
| 285 |
try:
|
| 286 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 287 |
print("DISTILLED ENTITIES:", entities)
|
| 288 |
except Exception as e:
|
| 289 |
print("❌ DISTILL ERROR:", str(e))
|
|
|
|
| 281 |
def entities_and_types(sentence):
|
| 282 |
ner_output = extract(sentence)
|
| 283 |
print("RAW NER OUTPUT:", ner_output)
|
| 284 |
+
|
| 285 |
try:
|
| 286 |
+
if ner_output != []:
|
| 287 |
+
entities = distill_entities(ner_output)
|
| 288 |
+
else:
|
| 289 |
+
output_list = jsons_to_list_of_lists(extract(sentence))
|
| 290 |
+
entities = distill_entities(output_list)
|
| 291 |
print("DISTILLED ENTITIES:", entities)
|
| 292 |
except Exception as e:
|
| 293 |
print("❌ DISTILL ERROR:", str(e))
|