Skip to content

Instantly share code, notes, and snippets.

@ajayjapan
Last active June 24, 2020 03:55
Show Gist options
  • Save ajayjapan/6772abc074e2c6ece444dfb8fe076781 to your computer and use it in GitHub Desktop.
Save ajayjapan/6772abc074e2c6ece444dfb8fe076781 to your computer and use it in GitHub Desktop.
import spacy
nlp = spacy.load("en_core_web_sm")
article = "This is the content of the article. It consists of many sentences."
doc = nlp(article)
[sent.text for sent in doc.sents]
# Output: [‘This is the content of the article.’, ‘It consists of many sentences.’]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment