Alexandre-Numind commited on
Commit
541eb78
·
verified ·
1 Parent(s): a95c19f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -44,7 +44,7 @@ def merge_entities(entities):
44
  current = entities[0]
45
  for next_entity in entities[1:]:
46
  if next_entity['entity'] == current['entity'] and (next_entity['start'] == current['end'] + 1 or next_entity['start'] == current['end']):
47
- current['word'] = text[current['start']: next_entity['end']].strip()
48
  current['end'] = next_entity['end']
49
  else:
50
  merged.append(current)
 
44
  current = entities[0]
45
  for next_entity in entities[1:]:
46
  if next_entity['entity'] == current['entity'] and (next_entity['start'] == current['end'] + 1 or next_entity['start'] == current['end']):
47
+ current['word'] += ' ' + next_entity['word']
48
  current['end'] = next_entity['end']
49
  else:
50
  merged.append(current)