473,398 Members | 2,525 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

NLTK, Random Sentence Generators?


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.
Apr 10 '07 #1
8 5486
Passer By wrote:
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
Apr 10 '07 #2
James Stroud <js*****@mbi.ucla.eduwrites:
Passer By wrote:
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.
Emotive on Usenet? Thats original.
Apr 10 '07 #3
On Apr 10, 1:36 am, Passer By <sen...@sender.sendwrote:
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.
Markov chains e.g.
http://rubyquiz.com/quiz74.html

Apr 10 '07 #4
gene tani escreveu:
On Apr 10, 1:36 am, Passer By <sen...@sender.sendwrote:
>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.

Markov chains e.g.
http://rubyquiz.com/quiz74.html
Seems interesting ... Is there anybody who masters both python and ruby
to "translate" the code into python?
Apr 10 '07 #5
On Apr 10, 1:59 pm, Paulo da Silva <psdasil...@esotericaX.ptXwrote:
gene tani escreveu:
On Apr 10, 1:36 am, Passer By <sen...@sender.sendwrote:
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.
Markov chains e.g.
http://rubyquiz.com/quiz74.html

Seems interesting ... Is there anybody who masters both python and ruby
to "translate" the code into python?
Wouldn't it be easier to translate Python:

<http://www.strout.net/python/shaney.py>

Apr 10 '07 #6
Passer By wrote:
James Stroud <js*****@mbi.ucla.eduwrites:

>>Passer By wrote:

>>>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.


Emotive on Usenet? Thats original.

Anonimity on usenet? That's suspiscious.

Apr 10 '07 #7
James Stroud <js*****@mbi.ucla.eduwrites:
Passer By wrote:
James Stroud <js*****@mbi.ucla.eduwrites:
>Passer By wrote:
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.
Emotive on Usenet? Thats original.
Anonimity on usenet? That's suspiscious.
Paranoid Plunk?
Apr 12 '07 #8
On Apr 12, 4:36 am, Passer By <sen...@sender.sendwrote:
James Stroud <jstr...@mbi.ucla.eduwrites:
Passer By wrote:
James Stroud <jstr...@mbi.ucla.eduwrites:
>>Passer By wrote:
>>>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.
Emotive on Usenet? Thats original.
Anonimity on usenet? That's suspiscious.

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.

Apr 12 '07 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Brandon Michael Moore | last post by:
I'm trying to test a web application using a tool written in python. I would like to be able to generate random values to put in fields. I would like to be able to generate random dates (in a...
0
by: Katja Filippova | last post by:
hi, Has anybody tried using natural language toolkit (http://nltk.sourceforge.net/) under Python (my version is 2.1.1)? problems: first, I wanted to import a module, as it is written in the...
1
by: ekyungchung | last post by:
I did install the python 2.4 and nltk. I am trying to follow the tutorial, but I kept getting error messages about importing corpus as follows ===================================================...
7
by: Ioannis Vranos | last post by:
I want to create some random numbers for encryption purposes, and i wonder if the following scheme makes it more hard to guess the underneath number generation pattern, than the plain use of...
40
by: RadiationX | last post by:
I have a problem that I really don't understand at all. In my previous post I could get started on my projects I just had a few problems with syntax errors. This problem is something that I don't...
1
by: Steven Bird | last post by:
NLTK — the Natural Language Toolkit — is a suite of open source Python modules, data sets and tutorials supporting research and development in natural language processing. It comes with 50k lines...
0
by: urkel | last post by:
Hello everybody, I have these errors on C program that may be because of random number definition. I use an SSH to compile C like in Linux. May be you have idea whether the errors are due to the...
16
by: jason.cipriani | last post by:
I am looking for a random number generator implementation with the following requirements: - Thread-safe, re-entrant. - Produces consistently reproducible sequences of psuedo-random numbers...
5
by: hussainsaiger | last post by:
I am trying to convert a python module (that contains the use of NLTK.Corpus) by jythonc. It is not able to include nltk dependencies within the java class it creates. So when i use this class in...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.