Spaces:
Running
Running
Mike
commited on
Commit
·
babd965
1
Parent(s):
21d9527
add aggregation step
Browse files
app.py
CHANGED
@@ -13,15 +13,17 @@ examples = [
|
|
13 |
def ner(text):
|
14 |
output_skills = token_skill_classifier(text)
|
15 |
for result in output_skills:
|
16 |
-
if result.get("
|
17 |
-
tag = result["
|
18 |
-
result["entity"] = tag + "-
|
|
|
19 |
|
20 |
output_knowledge = token_knowledge_classifier(text)
|
21 |
for result in output_knowledge:
|
22 |
-
if result.get("
|
23 |
-
tag = result["
|
24 |
-
result["entity"] = tag + "-
|
|
|
25 |
|
26 |
output = output_skills + output_knowledge
|
27 |
return {"text": text, "entities": output}
|
|
|
13 |
def ner(text):
|
14 |
output_skills = token_skill_classifier(text)
|
15 |
for result in output_skills:
|
16 |
+
if result.get("entity_group"):
|
17 |
+
tag = result["entity_group"]
|
18 |
+
result["entity"] = tag + "-Skill"
|
19 |
+
del result["entity_group"]
|
20 |
|
21 |
output_knowledge = token_knowledge_classifier(text)
|
22 |
for result in output_knowledge:
|
23 |
+
if result.get("entity_group"):
|
24 |
+
tag = result["entity_group"]
|
25 |
+
result["entity"] = tag + "-Knowledge"
|
26 |
+
del result["entity_group"]
|
27 |
|
28 |
output = output_skills + output_knowledge
|
29 |
return {"text": text, "entities": output}
|