Skip to content

Commit 4d14f4d

Browse files
committed
ensure that a span is not skipped just because its head is 0
1 parent fba9b95 commit 4d14f4d

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
@@ -163,7 +163,7 @@ def process_documents(docs, augment=False):
163163
# words from 0, so we have to subtract 1 from the stanza heads
164164
#print(span, candidate_head, parsed_sentence.words[candidate_head].head - 1)
165165
# treat the head of the phrase as the first word that has a head outside the phrase
166-
if parsed_sentence.all_words[candidate_head].head and (
166+
if (parsed_sentence.all_words[candidate_head].head is not None) and (
167167
parsed_sentence.all_words[candidate_head].head - 1 < span[1] or
168168
parsed_sentence.all_words[candidate_head].head - 1 > span[2]
169169
):

0 commit comments

Comments
 (0)