Skip to content

Instantly share code, notes, and snippets.

@sevperez
Created August 24, 2020 21:45
Show Gist options
  • Save sevperez/5bc95027710765bf9a5678ee2e1c31f8 to your computer and use it in GitHub Desktop.
Save sevperez/5bc95027710765bf9a5678ee2e1c31f8 to your computer and use it in GitHub Desktop.
# load the full text and put it through the pipeline
def load_text_doc(file_path):
with open(file_path) as f:
txt = f.read()
return txt
moby_path = "moby_dick.txt"
moby_dick_text = load_text_doc(moby_path)
moby_dick = nlp(moby_dick_text)
print_doc_info(moby_dick)
# Num sentences: 9966
# Num tokens: 253928
# Num words: 253928
# Num entities: 7955
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment