NLTK, Random Sentence Generators?

P

Passer By

Has any created or not of examples of random sentence generators using
n-gram models (or other models might be interesting).

I know of one example from a course at MIT, but besides that nothing.

Any help would be great.
 
J

James Stroud

Passer said:
Has any created or not of examples of random sentence generators using
n-gram models (or other models might be interesting).

I know of one example from a course at MIT, but besides that nothing.

Any help would be great.

Best is to just cull text from your spam folder as these are often
generated by similar means--but somehow I think you knew that.

James
 
P

Passer By

James Stroud said:
Best is to just cull text from your spam folder as these are often
generated by similar means--but somehow I think you knew that.

Emotive on Usenet? Thats original.
 
O

Oleg Alexander

Paranoid Plunk?- Hide quoted text -

- Show quoted text -

Another way to generate random text is by using context free grammars
and recursive substitution. Here are some examples of programs which
use this technique:

http://nonsense.sourceforge.net/
http://www.elsewhere.org/pomo

The programs generate from a user-defined "grammar" file, which looks
something like this:

ROOT
$sentence

SENTENCE
I $feelabout my $animal!

FEELABOUT
love
hate

ANIMAL
dog
cat

The above grammar will generate the following possible sentences:

I love my cat!
I hate my cat!
I love my dog!
I hate my dog!

Unlike a Markov generator, the output of these programs is
grammatically correct.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top