Skip to content

Commit fba9b95

Browse files
committed
patch error more specifically
1 parent aa2f2d6 commit fba9b95

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

stanza/utils/datasets/coref/convert_udcoref.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ def process_documents(docs, augment=False):
205205
[(old_to_new[start], old_to_new[end - 1] + 1) for start, end in cluster]
206206
for cluster in span_clusters
207207
]
208-
except:
208+
except (KeyError, TypeError) as _: # two errors, either end-1 = -1, or start/end is None
209209
warnings.warn("Somehow, we are still coreffering to a zero. This is likely due to multiple zeros on top of each other. We are giving up.")
210210
continue
211211
word_clusters = [

0 commit comments

Comments
 (0)