Skip to content

Instantly share code, notes, and snippets.

@jabirjamal
Last active July 23, 2021 06:11
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 jabirjamal/7578038a42103f02beb723bc41e750b9 to your computer and use it in GitHub Desktop.
Save jabirjamal/7578038a42103f02beb723bc41e750b9 to your computer and use it in GitHub Desktop.
Sentence segmentation
import spacy
nlp = spacy.load("en_core_web_md")
text = "I flew to Melbourne yesterday. I was at my hotel at 5 pm."
doc = nlp(text)
for sent in doc.sents:
print("***")
print(sent.text)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment