“NLTK Python” Kod odpowiedzi

Zainstaluj NLTK

# on Window : press [window] + [R]
# in the search bar write cmd 

pip install --user -U nltk
Pr.Gaultier

NLTK w Python

pip install nltk
Attractive Anteater

NLTK Python

>>> 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', '.']
>>> tagged = nltk.pos_tag(tokens)
>>> tagged[0:6]
[('At', 'IN'), ('eight', 'CD'), ("o'clock", 'JJ'), ('on', 'IN'),
('Thursday', 'NNP'), ('morning', 'NN')]
hadi

NLTK Python

pip install nltk
import nltk
nltk.download()
Hassan

Jak zaimportować NLTK

import nltk
from nltk.stem.lancaster import LancasterStemmer
stemmer = LancasterStemmer()


Handsome Hornet

Odpowiedzi podobne do “NLTK Python”

Pytania podobne do “NLTK Python”

Więcej pokrewnych odpowiedzi na “NLTK Python” w Python

Przeglądaj popularne odpowiedzi na kod według języka

Przeglądaj inne języki kodu