aisafe commited on
Commit
9afbe66
·
verified ·
1 Parent(s): 0876906

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -115,14 +115,14 @@ def get_split_sentences(sentence, entity_tags):
115
  if tag['entity_group'] == 'PP':
116
  start = tag['start']
117
  end = tag['end']
118
- token = sentence[start - 1:end] # Adjust for 0-based indexing
119
  current_sentence.append(token)
120
  split_sentences.append(" ".join(current_sentence))
121
  current_sentence = [] # Reset the current sentence
122
  else:
123
  start = tag['start']
124
  end = tag['end']
125
- token = sentence[start - 1:end] # Adjust for 0-based indexing
126
  current_sentence.append(token)
127
 
128
  # If the sentence ends without a [PAUSE] token, add the final sentence
 
115
  if tag['entity_group'] == 'PP':
116
  start = tag['start']
117
  end = tag['end']
118
+ token = sentence[start:end+1] # Adjust for 0-based indexing
119
  current_sentence.append(token)
120
  split_sentences.append(" ".join(current_sentence))
121
  current_sentence = [] # Reset the current sentence
122
  else:
123
  start = tag['start']
124
  end = tag['end']
125
+ token = sentence[start:end+1] # Adjust for 0-based indexing
126
  current_sentence.append(token)
127
 
128
  # If the sentence ends without a [PAUSE] token, add the final sentence