Created
September 7, 2023 11:46
-
-
Save fsndzomga/87d0ac6a342e1b3ec68a4e85ed0a5f5d to your computer and use it in GitHub Desktop.
Tokenisation using NLTK
This file contains 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
from nltk.tokenize import word_tokenize | |
sentence = "Natural Language Processing is fascinating." | |
tokens = word_tokenize(sentence) | |
print(tokens) | |
# Output: ['Natural', 'Language', 'Processing', 'is', 'fascinating', '.'] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment