X hits on this document

Powerpoint document

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

163 views

0 shares

0 downloads

0 comments

38 / 47

Example: Conditioning on a Word’s Initial Letter

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

Document info
Document views163
Page views163
Page last viewedThu Jan 19 09:16:04 UTC 2017
Pages47
Paragraphs392
Words1978

Comments