X hits on this document

Powerpoint document

Python for NLP and the Natural Language Toolkit - page 43 / 47

176 views

0 shares

0 downloads

0 comments

43 / 47

Example: Predicting Words

Predict word's type, based on preceding word type

>>> from nltk.token import WSTokenizer       

  >>> from nltk.probability import ConditionalFreqDist                                               >>> corpus = open('corpus.txt').read()                 >>> tokens = WSTokenizer().tokenize(corpus) >>> cfdist = ConditionalFreqDist()  #empty

Document info
Document views176
Page views176
Page last viewedSat Jan 21 06:21:15 UTC 2017
Pages47
Paragraphs392
Words1978

Comments