Advertisement
Guest User

Untitled

a guest
Jul 19th, 2019
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. sen = "A fawn was racing in the forest!He was ahead of the rabbit?He
  2. was ahead of the elephant."
  3. nlp = spacy.load('en')
  4. nlp.add_pipe(nlp.create_pipe('sentencizer'), first=True)
  5. doc = nlp(sen)
  6. sentences = [sent.string.strip() for sent in doc.sents]
  7.  
  8. "A fawn was racing in the forest!"
  9.  
  10. "He was ahead of the rabbit?"
  11.  
  12. "He was ahead of the elephant."
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement