Skip to content
This repository has been archived by the owner on Aug 14, 2024. It is now read-only.

Commit

Permalink
Add: Remove word boundary from regex
Browse files Browse the repository at this point in the history
  • Loading branch information
amant555 committed Jun 23, 2021
1 parent 9be8661 commit 499884a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions label_studio/tasks/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,13 +209,13 @@ def fetch_diff(list1, list2):
change = fetch_diff(added, new_added)
for i in change:
new_draft.remove(i)
added=new_added
added = new_added
for annotation in tqdm(added):
annotated_text = annotation['value']['text']
label = annotation['value']['labels'][0] # ToDo Add inclusion list
original_start = annotation['value']['start']
original_end = annotation['value']['end']
pattern = re.compile(r'\b' + re.escape(annotated_text) + r'\b')
pattern = re.compile(re.escape(annotated_text))
for found in pattern.finditer(text):
start = found.span()[0]
end = found.span()[1]
Expand Down

0 comments on commit 499884a

Please sign in to comment.