Live data from Hacker News

Generating random text

cs.bell-labs.com

1–10 of 29 posts

Re: Generating random text

#2
I remember reading about that in "The Information", where it is described how Claude Shannon did it.

Now I'll have to tweak my spam detection even more. Joke aside and somebody correct me if I'm wrong, spam probably runs on a simple wordlist type algorithm.

What is then the usefulness (I define usefulness extremely wide) of such a generator?

Re: Generating random text

#4

I remember reading about that in "The Information", where it is described how Claude Shannon did it. Now I'll have to tweak my spam detection even more. Joke aside and somebody correct me if I'm wrong, spam probably runs on a simple wordlist type algorithm. What is then the usefulness (I define usefulness extremely wide) of such a generator?

If you have a good generator for text, you have a useful language model that can be plugged into applications such as speech recognition, OCR, predictive text entry systems and compression.

Re: Generating random text

#5
Markov chains are always good fun to play with... a few months ago I worked on a class project which generated markov models from Final Fantasy SNES tracks. (https://github.com/IsaacLewis/MidiMarkov). I should blog about it at some point.

I hadn't seen Shannon's algorithm before though, which looks a bit more memory efficient than the approach I used.

Re: Generating random text

#7
post #4

I remember reading about that in "The Information", where it is described how Claude Shannon did it. Now I'll have to tweak my spam detection even more. Joke aside and somebody correct me if I'm wrong, spam probably runs on a simple wordlist type algorithm. What is then the usefulness (I define usefulness extremely wide) of such a generator?

If you have a good generator for text, you have a useful language model that can be plugged into applications such as speech recognition, OCR, predictive text entry systems and compression.

Could you somehow use it in reverse? What I mean is, is it possible to get a random text generator for a certain language and then use it to determine, whether a given text is in that language or not?

Re: Generating random text

#8
post #4

Earlier quoted context omitted.

If you have a good generator for text, you have a useful language model that can be plugged into applications such as speech recognition, OCR, predictive text entry systems and compression.

Could you somehow use it in reverse? What I mean is, is it possible to get a random text generator for a certain language and then use it to determine, whether a given text is in that language or not?

Yes.

Given the string so far, see how probable it is that the generator would generate the next character, p(x_n | x_For more on information theory, modelling and inference you might like: http://www.inference.phy.cam.ac.uk/mackay/itila/book.html

Re: Generating random text

#10
post #4

Earlier quoted context omitted.

If you have a good generator for text, you have a useful language model that can be plugged into applications such as speech recognition, OCR, predictive text entry systems and compression.

Could you somehow use it in reverse? What I mean is, is it possible to get a random text generator for a certain language and then use it to determine, whether a given text is in that language or not?

It sounds like you are talking about a naive Bayesian classifier. PG wrote a couple of articles on his experience with these for spam filtering (http://www.paulgraham.com/spam.html and http://www.paulgraham.com/better.html). They're probably a decent high-level introduction to the area.

For a more in-depth, yet very accessible discussion, I would recommend "Speech and Language Processing" by Jurafsky & Martin (http://books.google.com/books/about/SPEECH_AND_LANGUAGE_PROC...). It's considered by many to be the Bible of NLP.

Post reply on HN