Commit
·
3e981b2
1
Parent(s):
bf5f745
update index
Browse files
app.py
CHANGED
@@ -58,6 +58,8 @@ def extract_entities(sentence):
|
|
58 |
# [{'entity': 'org.ent.pressagency.Reuters', 'score': np.float32(98.47),
|
59 |
# 'index': 78, 'text': 'Reuters', 'start': 440, 'end': 447}]
|
60 |
for entity in results:
|
|
|
|
|
61 |
entity_span = (entity["start"], entity["end"])
|
62 |
|
63 |
# Only add non-overlapping entities
|
|
|
58 |
# [{'entity': 'org.ent.pressagency.Reuters', 'score': np.float32(98.47),
|
59 |
# 'index': 78, 'text': 'Reuters', 'start': 440, 'end': 447}]
|
60 |
for entity in results:
|
61 |
+
entity['start'] = entity['index'][0]
|
62 |
+
entity['end'] = entity['index'][1]
|
63 |
entity_span = (entity["start"], entity["end"])
|
64 |
|
65 |
# Only add non-overlapping entities
|