Spaces:
Running
Running
Mike
commited on
Commit
·
89c7e63
1
Parent(s):
a7c8f02
create two separate highlights
Browse files
app.py
CHANGED
@@ -40,9 +40,11 @@ def ner(text):
|
|
40 |
if result.get("entity_group"):
|
41 |
result["entity"] = "Knowledge"
|
42 |
del result["entity_group"]
|
43 |
-
|
44 |
-
|
45 |
-
|
|
|
|
|
46 |
|
47 |
return {"text": text, "entities": output_skills}, {"text": text, "entities": output_knowledge}
|
48 |
|
|
|
40 |
if result.get("entity_group"):
|
41 |
result["entity"] = "Knowledge"
|
42 |
del result["entity_group"]
|
43 |
+
|
44 |
+
if len(output_skills) > 0:
|
45 |
+
output_skills = aggregate_span(output_skills)
|
46 |
+
if len(output_knowledge) > 0:
|
47 |
+
output_knowledge = aggregate_span(output_knowledge)
|
48 |
|
49 |
return {"text": text, "entities": output_skills}, {"text": text, "entities": output_knowledge}
|
50 |
|