Created
August 24, 2020 21:40
-
-
Save sevperez/52b93340b395c2393ffee3716c359a12 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def print_sentence_info(sentence): | |
| print(f"Text: {sentence.text}") | |
| print(f"Num tokens:\t{len(sentence.tokens)}") | |
| print(f"Num words:\t{len(sentence.words)}") | |
| print(f"Num entities:\t{len(sentence.entities)}") | |
| print_sentence_info(moby_p1.sentences[0]) | |
| # Text: Call me Ishmael. | |
| # Num tokens: 4 | |
| # Num words: 4 | |
| # Num entities: 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment