Friday, June 30, 2006

 

Speaking of constraints - a detour


I actually have a progression in mind for the series of Why is ALG hard? posts. But David Ayre's insightful comments, here and here, are worth pausing for. Especially in regard to the notion of constraints.

(BTW, ETC 1 controlled recursion in the way David suggests via a control structure that certain nodes passed down the utterance tree. But I just didn't like it--it was aesthetically displeasing (there's no accounting for taste), hard to change, and clumsy (which of course could be due to competency problems on my part). ETC 2 controls recursion by removing its possibility from the grammar. I'm still deciding about ETC 3. )

But back to the general notion of constraints. Aesthetic language generation presents certain interesting classes of problems in regard to constraints. For example, suppose you want to develop a system that generates sonnets (setting aside for now why you would ever want to do that). There are at least two categories of constraints that will have to be coded to solve this problem. First the text must rhyme and scan in a very specific way. Second, the text must present as meaningful expression.

These two sets of constraints will inevitably find themselves in contention with each other. Consider Shakespeare's Sonnet 101:

O truant Muse, what shall be thy amends
For thy neglect of truth in beauty dyed?
Both truth and beauty on my love depends;
So dost thou too, and therein dignified.
Make answer, Muse: wilt thou not haply say
'Truth needs no colour, with his colour fix'd;
Beauty no pencil, beauty's truth to lay;
But best is best, if never intermix'd?'
Because he needs no praise, wilt thou be dumb?
Excuse not silence so; for't lies in thee
To make him much outlive a gilded tomb,
And to be praised of ages yet to be.
Then do thy office, Muse; I teach thee how
To make him seem long hence as he shows now.

It doesn't take long to see the problem. The sentences may or may not coincide with lines, and in fact take up to three lines to complete. If an evaluation function decides that an utterance is subpar, and either asks for or provides a replacement (depending on the designer's philosophy about such things), meter and rhyme will evenutally be disrupted. Another evaluation function decides that that portion of the text no longer scans or rhymes within acceptable limits, and makes another change and now one or more utterances aren't well-formed English. We can't just let these guys duke it out until one gets tired and gives up--that only works in the humanities seminar. We have to cast this as an optimization problem and that makes me tired just thinking about it.

And if you are a diligent little OOP programmer, there is another, less theoretically interesting, but nasty problem to solve. What's the collection of objects that make up this piece? A collection of utterances? A collection of lines? Something else?

We'll leave that discussion for another day. For now, it might be interesting to observe how a human generates a form-centric text. (Click on "Play back the poem").

Comments: Post a Comment



<< Home

This page is powered by Blogger. Isn't yours?