Update generic_ner.py
Browse files- generic_ner.py +2 -0
generic_ner.py
CHANGED
|
@@ -57,6 +57,8 @@ def find_entity_indices(article_text, search_text):
|
|
| 57 |
original_end_index += 1 # Increment to include the last character
|
| 58 |
|
| 59 |
# Append the found indices to the list
|
|
|
|
|
|
|
| 60 |
indices.append((original_start_index, original_end_index))
|
| 61 |
|
| 62 |
# Move start_index to the next position to continue searching
|
|
|
|
| 57 |
original_end_index += 1 # Increment to include the last character
|
| 58 |
|
| 59 |
# Append the found indices to the list
|
| 60 |
+
if article_text[original_start_index] == ' ':
|
| 61 |
+
original_start_index += 1
|
| 62 |
indices.append((original_start_index, original_end_index))
|
| 63 |
|
| 64 |
# Move start_index to the next position to continue searching
|