Spaces:
Running
on
T4
Running
on
T4
Update app.py
Browse files
app.py
CHANGED
|
@@ -43,8 +43,8 @@ def merge_entities(entities):
|
|
| 43 |
merged = []
|
| 44 |
current = entities[0]
|
| 45 |
for next_entity in entities[1:]:
|
| 46 |
-
if next_entity['
|
| 47 |
-
current['
|
| 48 |
current['end'] = next_entity['end']
|
| 49 |
else:
|
| 50 |
merged.append(current)
|
|
|
|
| 43 |
merged = []
|
| 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)
|