“Python nltk tokenize” Kode Jawaban

Python nltk tokenize

>>> import nltk
>>> sentence = """At eight o'clock on Thursday morning
... Arthur didn't feel very good."""
>>> tokens = nltk.word_tokenize(sentence)
>>> tokens
['At', 'eight', "o'clock", 'on', 'Thursday', 'morning',
'Arthur', 'did', "n't", 'feel', 'very', 'good', '.']
Tame Trout

Impor Word_Tokenize

import nltk
from nltk import word_tokenize
Itchy Impala

nltk python cara tokenize teks

>>> tokens = word_tokenize(raw)
>>> type(tokens)
<class 'list'>
>>> len(tokens)
254354
>>> tokens[:10]
['The', 'Project', 'Gutenberg', 'EBook', 'of', 'Crime', 'and', 'Punishment', ',', 'by']
GelatinousMustard

Jawaban yang mirip dengan “Python nltk tokenize”

Pertanyaan yang mirip dengan “Python nltk tokenize”

Lebih banyak jawaban terkait untuk “Python nltk tokenize” di Python

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya