Return None if alignment fails
@@ -206,9 +206,7 @@ def align_word_pieces(spacy_tokens, wp_tokens, specials=SPECIAL_TOKENS):
spacy_string = "".join(spacy_tokens).lower()
wp_string = "".join(wp_tokens).lower()
if spacy_string != wp_string:
- print("spaCy:", spacy_string)
- print("WP:", wp_string)
- raise AssertionError((spacy_string, wp_string))
+ return None
output = _align(spacy_tokens, wp_tokens, offset)
return output
