Spaces:
Running
Running
Update app.py
Browse files
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
|
| 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
|
| 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
|