Skip to content

Instantly share code, notes, and snippets.

@quantra-go-algo
Created September 2, 2022 20:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save quantra-go-algo/d72b92c9fd47de2bc284e42c42ed9a94 to your computer and use it in GitHub Desktop.
Save quantra-go-algo/d72b92c9fd47de2bc284e42c42ed9a94 to your computer and use it in GitHub Desktop.
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