Skip to content

Instantly share code, notes, and snippets.

@quantra-go-algo
Created September 2, 2022 20:52
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
doc = nlp(text)
# Split the text into sentences
sentences = [sentence.text for sentence in doc.sents]
# Print the original text
print(f"Original text: \n\n{text}\n{'-'*50}\n")
# Print the different sentences from the text
print(
f"We have split the above into {len(sentences)} sentences:\n\n 1. {sentences[0]}\n2. {sentences[1]}")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment