books computer science miscellanea

Calliope and the Spambot

Calliope, Muse of Epic Poetry Randomly-generated spam email can have a certain “found art” quality to it. I’ve seen plenty of articles over the past few years gleefully musing over some chance juxtaposition in the inbox. See, for example, this article from The Register. A sample:

If you get it overnight, you can lose it just as quick
When Mumma dead family done.
Take heed of reconciled enemies and of meat twice boiled

The algorithms that generate these messages are quite simple, for the most part. The most common is the Markov chain.  A program of this type first takes a corpus of text and analyzes it to generate a table of probabilities that a given word follows another. To create a first-order Markov chain based on words in the corpus, the program repeatedly asks and answers the following question: given a certain word, what are the most likely words to follow it in the source text? It then randomly picks one of those following words, weighting its choice by the calculated probabilities.  After that, it picks the next word using the word it just generated as the base. A second-order chain bases its probabilities on the previous two words, and so on. Increasing the order of the chain can produce more authentic-seeming phrases.

One of the most common methods of content-filtering spam is Bayesian analysis, which uses a related algorithm to analyze the probability that a particular message is spam, based on the frequency of words in other messages already received and identified. If you are a spammer, the care and feeding of your spambot, your bulk mailer, is matter of great concern. You need to produce messages that have enough randomness to slip through recipients’ spam filters, but that look like they could be a valid messages. Project Gutenberg was an early source of texts for these Markov text generators, resulting in bathetic, surprisingly pseudo-literary nonsense.

I received the following message this morning, the text of which I reproduce in its entirety:

Summer bees were saying
That desire has ever built, have approached
How can they get the point of how a world
Pallid waste where no radiant fathomers,
From there. Toward . . .
demonstrating their talent for comedy?stroke
Glimmering of light:
Rise, to the muffled chime of churchbell choir.
Reshaping magnified, each risen flake
XVII. Greenland
Silent patch of ultimate paint. You are
marked with a dark stroke from the left, encroached
A matter of getting all that right . . .
What I have in my hands, these flowers, these shadows,
Come, swallows, it’s good-bye.
Place of absorbing snow, itself to be
With a hand freed from weight,
Is the moon to grow
Suddenly, in a savage, dreadful bend,

With minor editing (particularly the punctuation), this could almost be passed of as something from a modern poetry review . . . and here’s why: rather than generate its text word-by-word, the bulk mailer worked line-by-line from actual poems. (The line “XVII. Greenland” is a good clue.) A bit of Googling revealed that most of these lines can be found on a particular page of poems about winter on the website of the University of Chicago Press. The unfortunate question-mark in line 6 is an em-dash on the source page.

PIPO: Poetry In; Poetry Out.

This recalls to mind one of my favorite pieces of randomly-generated text.  In 2004, a group of SFWA members set out to show that a company called “PublishAmerica” is not a “traditional” publisher (that is, that they do not engage in any sort of editorial quality-control over their books).  To this end, this group produced a very good candidate for the worst novel ever written: Atlanta Nights.  Each chapter was written by a different person to be as terrible as possible.  Chapter 34 was actually machine-generated using the rest of the book as the source material.  The pseudonymous author-of-record, “Travis Tea”, now has his own web site.

[Image of Calliope, Muse of epic poetry, courtesy of Wikipedia.]

6 replies on “Calliope and the Spambot”

“The longtime security guard saluted the pair as they passed. What lucky people, he thought, so young and rich, they can afford to live here. Not like me. I have to live across town and wear a uniform and salute the young rich kids who make more money in a minute than I can make in my whole life.”

This is priceless!

It is a work of a sort of nauseating genius.

“He hacked again, grossly, though. ‘I wish I could, Isadore. I wish I could.’ He looked up at her with wet eyes–eyes like he’d had too many drinks or had just gotten kicked in the groin.”

“She preened to herself again. A fine young man like this, and she could still grab him. What a dame she was.”

Once you start reading, it’s horribly addictive.

“He coughed again, then reached down to his privates, like he was making sure they were still there. He left big red hand prints on them–you could certainly judge his length by his hands! And they said that was a myth. Ha, she thought knowingly. All things have a basis in fact.”

““We will therefore just monitor his sign’s. Serious trauma like this patient suffered requires extra care, but the rich patsies controlling the hospital will make certain I cannot try any of my new treatments on him.”

“Yes, doctor.” That voice was soooo sexy!

Bruce didn’t care about treatments. He cared about pain, and he cared about that voice, because when he heard the voice, the pain went away, just for a few seconds, like.”


“She smoothed the hair back from her elfin ears, making it tumble down her back, past her shoulders, broad but not too broad, broad enough to support the luxurious breasts that filled the front of her scarlet sun dress, glowing in the afternoon sun, the hot Georgia orb of fire, that came through the window, as she admired her trim shape and flat tummy, in the mirror. She looked, she thought, like the bad-girl heroine of a tawdry romance novel.”

“‘Hey now, I don’t like that,’ Isaacs said, and now he was mad at all of them for ruining his day. He was mad enough to hurt somebody. He’d killed a man before one time, with his bare hands, and he could do it again, if he put something in his bare hands like a knife or a gun or something that he could kill somebody with.”
“Behind his back, stiletto heels clicked, but not sharply and intensely like they would on wood or marble, rather with a little sogginess to them, a sort of muffled slurping caused by their impacting asphalt that had gone soft and resilient in the hot Atlanta sun. He liked stiletto heels a lot, so he turned to see who was coming.

It was Callie Archer, old Henry’s widow. God, she was a looker, with those glossy black tresses and fine, fines hooters.”
“Noisy café noise.

Moments later, their young strawberry-auburn-headed waitress attended them with a pleasing winsome grin full of healthy teeth and gums. Her generous bosom swept forward in her tightfitting blouse, unbuttoned precariously and yet full of devious intent to reveal the tender rosy heaving flesh under the starched straining cotton.

‘What may I get you, gentlemen?’ she said in a honey pert voice, and a flash of white pearly teeth in a face of unusual refinement for such a creature. What was she doing hear in this seething and empties a trendy morass of human dross and raging worldly clamor?

‘Ah,’ mused, Isadore to himself, ‘She is another unfortunate, probably alone in the world and needing to pay her way in the world of men. She may be writing a novel in secret, and I know her kind.’ And he had an immediate need to comfort and console her, and felt a pang of desire in his southern regions of the hard young body.”

Leave a Reply

Your email address will not be published. Required fields are marked *