sort ner results
Browse files
README.md
CHANGED
@@ -81,6 +81,9 @@ for group, ents in grouped_ner_results.items():
|
|
81 |
current_ent = {"word": ents[i]['word'], "start": ents[i]['start'], "end": ents[i]['end'], "entity_group": group, "score": ents[i]['score']}
|
82 |
|
83 |
fixed_ner_results.append(current_ent)
|
|
|
|
|
|
|
84 |
|
85 |
# ===== print the ner_results
|
86 |
for ent in fixed_ner_results:
|
|
|
81 |
current_ent = {"word": ents[i]['word'], "start": ents[i]['start'], "end": ents[i]['end'], "entity_group": group, "score": ents[i]['score']}
|
82 |
|
83 |
fixed_ner_results.append(current_ent)
|
84 |
+
|
85 |
+
# sort entities
|
86 |
+
fixed_ner_results = sorted(fixed_ner_results, key=lambda e: e['start'], reverse=False)
|
87 |
|
88 |
# ===== print the ner_results
|
89 |
for ent in fixed_ner_results:
|