Sun, 26 May 1996

Pujangga: An experiment in computer-generated poetry

By Ruli Manurung

JAKARTA (JP): Computer Generated Writing has become quite a hot item of discussion. Evidence is on the Internet, where quite a lot of World Wide Web home pages have been dedicated to research in this field. And how far has it progressed? Will you find the next John Grisham, Shakespeare or Rendra hidden inside your personal computer? Never, you say? Well, you just may ...

The most memorable scenes from the sci-fi movie 2001: A Space Odyssey must be the ones that spotlighted HAL, the fictitious "intelligent" onboard computer. HAL spoke, reasoned, even felt emotions like a human being. Making a computer perform acts of intelligence from a scientific point of view is now possible, thanks to advances in the field of artificial intelligence. But a computer that shows emotions? Will that ever be possible? One answer: yes.

Notice the above question asks if a computer will be able to show emotions, not necessarily have them. For a computer to actually have emotions, well, for now, most computer science experts agree that it is as yet unthinkable. But, for a computer to express human emotions, say, perhaps through music, paintings, poetry? That's another matter.

Way back in 1986, I read an article in Discovery about a certain book, The Policeman's Beard is Half Constructed (published 1984), by William Chamberlain, that consisted of poetry that had been generated entirely by a computer. The authorship of the poems was attributed to RACTER, a small program that was written in compiled BASIC on a Z80 with 64k of RAM, an utterly crude specification by today's standards. RACTER, the program, was coauthored by Chamberlain and his colleague, Thomas Etter.

The article stated that RACTER had created touching poetry, some even exhibiting an existentialist streak, pondering RACTER's existence as a mere software program. How could this be? Had RACTER grown a soul, a mind, a heart? Well, not exactly. RACTER strings together words according to "syntax directives", a sort of rule that says whether a verb should go here, a noun should be inserted there, and some adverbs should be sprinkled evenly around. Randomly drawing from a massive vocabulary of English words, the illusion of coherence appeared, and poetry was created.

Here is an example of what RACTER could actually generated:

At all events my own essays and dissertations about love and its endless pain and perpetual pleasure will be known and understood by all of you who read this and talk or sing or chant about it to your worried friends or nervous enemies.

Love is the question and the subject of this essay. We will commence with a question: does steak love lettuce? This question is implacably hard and inevitably difficult to answer. Here is a question: does an electron love a proton, or does it love a neutron?

Enter Pujangga. Constructed by the Research and Technology Department of the Students Senate of the School of Computer Science at University of Indonesia, Pujangga is an experiment in generating Indonesian poetry from a computer.

Pujangga uses a technique developed in artificial intelligence research called Genetic Algorithms. Genetic Algorithms, or GAs for short, are computer-based solutions that find their inspiration from the way nature behaves from a Darwinist point of view.

The underlying theory of GAs is "the survival of the fittest". Like RACTER, Pujangga makes use of syntax directives consisting of some basic Indonesian sentence forms. The user may then choose the emotional mood of the poem about to be generated, ranging from funny to poetic.

Based on the user's choice, the GAs will select words from the supplied vocabulary according to a certain set of criteria. The whole process starts with the first "generation": a set of words that are randomly chosen.

Words that do not meet the given criteria shall perish, and those that comply continue on to the next generation. In the next generation of words, new words are created by mating some of the previous words, and sometimes randomly mutating one. This process continues until all the words selected are satisfactory for the mood requested by the user.

Here's a sample output from Pujangga, on a more serious, poetic tone:

goresan yang sombong, kumuh dan seram

mengharumkan dengan mentari

kala demi kala demi kala...

menyeramkan...

menyeramkan...

menyeramkan...

tetesan embun terbentang, kekasih memangsa

salibkan dengan keaslian

kasih menyanyi, kekasih merengkuh

Kapan kasih bersibak?

(Translation)

etchings of arrogance, filthy and scary

making fragrance with the sun

time upon time upon time...

frightening...

frightening...

frightening...

dewdrops spread out, lovers prey

crucify with truth

love sings, lovers reach out

When will love ripple?

And here is Pujangga out on a wacky limb, throwing words in all directions:

capung kenyang, got capek

Di mana alamat memberi?

obat yang kaya, bagus dan apes

obat dingin, alamat penuh

encok mengejar, koin lompat

capung lompat, koin bagus, encok kuning

Apakah cecurut mengajar?

Sejuta bola yang takut...

Translation:

bloated dragonfly, tired gutter

Where will the address give?

Rich medicine, good and unlucky

Cold medicine, full address

Rheumatic chases, coin jumps

Dragonfly jumps, good coin, yellow rheumatic

Does the sewer rat teach?

A million scared balls....

True heartfelt poetry, or just New Age babble rubbish? Poetry is such a subjective thing, so you may think what you want of it. One thing is certain: the human touch remains. Pujangga's vocabulary is only as limited as what the user feeds it. If the user feeds it nothing but dull words, for example, Pujangga would only generate a dull poem.

So, ultimately, Pujangga relies on the user for supplying a rich vocabulary. In the future, perhaps, you could feed Pujangga vocabulary and syntax directives based on Shakespeare, and voila, a new Shakespeare sonnet. Or input some of Chairil Anwar's works ... an instant new Aku.

Pujangga is still in an early prototype state, so there is no telling what may happen in the future. For all the technophobe computer-illiterate people who are afraid of the concept of a computer poet, be assured that the human heart still reigns superior. But humans can occasionally fall into a bad case of writers' block, whereas Pujangga can keep churning them out. To sum it up, here's a line from Pujangga in a mixed-up mode:

Seribu kita yang cemas

mengancam, menyakiti

Sejuta saya yang palsu

Translation:

A thousand of us worried,

threatening, hurting

a million fake me's

Perhaps Pujangga knows that it is a fake poet after all, and that we are all afraid of it ...