Skip to content

Commit

Permalink
Merge pull request #77 from joeyism/master
Browse files Browse the repository at this point in the history
Updated to fix E966 in spacy
  • Loading branch information
HHousen authored Dec 12, 2022
2 parents 15bd11d + c7a8863 commit c7e7180
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/extractive.py
Original file line number Diff line number Diff line change
Expand Up @@ -1098,7 +1098,14 @@ def predict_sentences(
else:
nlp = English()
sentencizer = nlp.create_pipe("sentencizer")
nlp.add_pipe(sentencizer)
try:
nlp.add_pipe(sentencizer)
except ValueError as e:
if e.args[0].startswith("[E966]"):
nlp.add_pipe("sentencizer")
else:
raise e


src_txt = [
" ".join([token.text for token in nlp(sentence) if str(token) != "."])
Expand Down

0 comments on commit c7e7180

Please sign in to comment.