Dagobert42
commited on
Commit
•
26f466f
1
Parent(s):
ec77f50
fix sentence annotation
Browse files- helpers.py +3 -1
helpers.py
CHANGED
@@ -6,6 +6,8 @@ colors = {
|
|
6 |
'SequenceVariant': '#e2b0ff', # Pastel purple
|
7 |
'CellLine': '#ffcc99' # Pastel peach
|
8 |
}
|
|
|
|
|
9 |
output = []
|
10 |
i = 0
|
11 |
for p in predictions:
|
@@ -17,6 +19,6 @@ colors = {
|
|
17 |
else sentence[p['start']:p['end']]
|
18 |
)
|
19 |
i = p['end']
|
20 |
-
if sentence[
|
21 |
output.append(sentence[p['end']:])
|
22 |
return output
|
|
|
6 |
'SequenceVariant': '#e2b0ff', # Pastel purple
|
7 |
'CellLine': '#ffcc99' # Pastel peach
|
8 |
}
|
9 |
+
|
10 |
+
def annotate_sentence(sentence, predictions):
|
11 |
output = []
|
12 |
i = 0
|
13 |
for p in predictions:
|
|
|
19 |
else sentence[p['start']:p['end']]
|
20 |
)
|
21 |
i = p['end']
|
22 |
+
if sentence[i:] != '':
|
23 |
output.append(sentence[p['end']:])
|
24 |
return output
|