GitXplorerGitXplorer
k

nltkfun

public
9 stars
2 forks
0 issues

Commits

List of commits on branch master.
Unverified
99fcd320a8a16d52ed7ba40482f7012e7d9d8ac3

Fixed code formatting

kkopertop committed 12 years ago
Unverified
31acb9a4d94352b2af194b3803a09ed06fe5dee0

Added generator and some documentation

kkopertop committed 12 years ago
Unverified
b60e46bab8adbb1161bc95eb1167a2776806e3f6

first commit

kkopertop committed 12 years ago

README

The README file for this repository.

Fun with python NTLK

This project is simply designed to house some fun things that I've done with NLTK. Most of this is based off of the examples found in the very great Natural Language Processing with Python

To get started, you'll need to install NLTK You might also want to install simple corpa to test these scripts.

Generation of text in a given style

You can use the "PhraseGenerator" to generate text following a given style. For example you can generate phrases that are similar to the style used by Obama in his Inaugural speach in 2009:

>>> import nltk
>>> from generator import PhraseGenerator
>>> gen = PhraseGenerator(nltk.corpus.inaugural, '2009-Obama.txt')

To start a phrase with "I", simply run:

>>> gen('i')

which might give you something like:

I thank you to those leaders around the answer is too costly; that finally decides our nation, but because of every end to the question we ask today.