X hits on this document

Powerpoint document

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

119 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 views119
Page views119
Page last viewedMon Dec 05 17:27:26 UTC 2016
Pages47
Paragraphs392
Words1978

Comments