Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- sen = "A fawn was racing in the forest!He was ahead of the rabbit?He
- was ahead of the elephant."
- nlp = spacy.load('en')
- nlp.add_pipe(nlp.create_pipe('sentencizer'), first=True)
- doc = nlp(sen)
- sentences = [sent.string.strip() for sent in doc.sents]
- "A fawn was racing in the forest!"
- "He was ahead of the rabbit?"
- "He was ahead of the elephant."
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement