X hits on this document

Powerpoint document

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

105 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 views105
Page views105
Page last viewedSat Dec 03 11:07:38 UTC 2016
Pages47
Paragraphs392
Words1978

Comments