Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

nltk python how to tokenize text

>>> tokens = word_tokenize(raw)
>>> type(tokens)
<class 'list'>
>>> len(tokens)
254354
>>> tokens[:10]
['The', 'Project', 'Gutenberg', 'EBook', 'of', 'Crime', 'and', 'Punishment', ',', 'by']
Source by www.nltk.org #
 
PREVIOUS NEXT
Tagged: #nltk #python #tokenize #text
ADD COMMENT
Topic
Name
1+7 =