emanuelaboros commited on
Commit
c2d3af5
·
1 Parent(s): 3e981b2

update index

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -58,8 +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['start'] = entity['index'][0]
62
- entity['end'] = entity['index'][1]
63
  entity_span = (entity["start"], entity["end"])
64
 
65
  # 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["lOffset"]
62
+ entity["end"] = entity["rOffset"]
63
  entity_span = (entity["start"], entity["end"])
64
 
65
  # Only add non-overlapping entities