Wednesday, April 11, 2012

Wolfram Alpha Shakespeare

This morning a reader sent me this link about what happens when you tell search engine Wolfram Alpha about Shakespeare's plays:

Entering a play into Wolfram|Alpha, like A Midsummer Night’s Dream, brings up basic information, such as number of acts, scenes, and characters. It also provides more in-depth info like longest word, most frequent words, number of words and sentences, and more. It’s also easy to find more specific information about a particular act or scene with queries like “What is the longest word in King Lear?”, “What is the average sentence length of Macbeth?”, and “How many unique words are there in Twelfth Night?”.
I suppose this has value at some level.  But if anything it goes to show how limited a pure textual analysis is, don't you think?  Great, it can determine the longest word in a play.  But who gets to decide what that means, and why it is (or is not) important?

Reminds me of an age-old quote, attributed to Picasso:  "Computers are useless. They can only give you answers."

I've always been far more intrigued with stories of AI in computer science where they attempt to make sure leaps about things that are important, and why they are important.  Pioneers Doug Lenat and Roger Schank did a great deal of work in this area -- Lenat's "Cyc" project can easily be seen as a precursor to what Wolfram Alpha has become.

Something that I've always dreamed about, and who knows maybe one day I'll build it, is a sort of search engine where you ask questions of the characters from within the context of the play, like one of those murder mystery tv shows where you're the detective coming in to question the suspects.  "Hamlet, why did you kill Polonius?"  "I thought he was my uncle."  "When did you do it?"  "When I went to see my mother in her bedchamber, after we saw the play."  That sort of thing.  And you could switch around your context to ask different characters their take on the same situation.

That wouldn't have any academic value per se, as the programmer would have to pick a specific interpretation of events and then state it as if it were fact.  But as far as entertaining the user while also teaching her something?  I think it could be a big hit.  "Chat bots" have always been amusing, to a degree.  This would just take it to the next level.

5 comments:

Ophelia said...

That is so cool! Just, wow.
Being able to ask a character questions? That's what actors are for, in my opinion.

Duane Morin said...

My issue, Ophelia, has been that the vast majority of people in the world will never have first-person access to theatrical resources like that. Live theatre is a luxury. Therefore I'm a big fan of having as much Shakespeare in your pocket as is technologically possible.

JM said...

Duane,
If by, "But if anything it goes to show how limited a *pure textual analysis* is, don't you think?" you're speaking only about the example you cite, then I can *almost* agree--but only in that severely limited context. In some esoteric realm of study, linguistic geniuses might have a field day with such info. But as far as practical, everyday textual analysis, in relation to the material itself, it doesn't really apply.

So if you're equating compiling pure minutiae for its own sake; mere bean counting with a computer, with the intent and technique of normal "textual analysis",in my view, the simplistic categorization isn't accurate--or fair. Really, it's out of context. Then, you're not speaking about anything remotely related to the practical technical analysis most interested people spend quite a bit of time learning how to employ and teach.

For instance, finding out the possible utility (or even having a clue in the first place that it might be important to understanding character and/or emotional analysis)as to *why* Macbeth might speak for an extended ten lines of verse without stopping, therefore constituting a sentence that is far from "average", and investigating the reasons as to why it might have been composed that way, and the uses it might point to in the development of the scene, is also 'pure textual analysis'.
That is only one example of using *one* of the tools of textual analysis in the attempt to evaluate what is happening within a character or scene.

In the end, for those reasons, I don't agree that the example you gave shows "how limited a pure textual analysis is". Pure textual analysis has little, if anything, to do with computers counting words.

Duane Morin said...

All I meant, J, was that it shows the limits of what the computer brings to the table, and where the addition o human insight has to come in as well. That's why I brought up that Picasso quote. I'm waiting for the day where the computer decides on its own that Macbeth uses a higher frequency of "darkness" words whenever the character of Macbeth is on stage, or that the average length of Lear's speeches gets shorter as the play progresses, or any other number of leaps like that which show some sort of value add.

If all we ever do is build better tools to answer our on questions, that's certainly ok for what it is. And good textual analysis tools are indeed a big deal. I've always been more interested in the artificial intelligence side of it, though. I want the computer to come up with ideas of its own.

There also comes a point when correlation and causality becomes an issue. Once, back in a sociology class in college, I had some 25 or so variables from a survey that we did, and I was tasked with figuring out what we'd learned. So I wrote a script to check for correlation of every variable against every other variable, found the strongest correlations, and then wrote my paper about those. The teacher was not pleased. :)

But, too much textual analysis can easily go down that path, don't you think? What if it does turn out that there's a higher frequency of darkness words whenever Macbeth is on stage? That doesn't say anything at all about whether Shakespeare meant that.

JM said...

"What if it does turn out that there's a higher frequency of darkness words whenever Macbeth is on stage? That doesn't say anything at all about whether Shakespeare meant that."

OK. But since poetic language is all about imagery and metaphor it more than *might* say something about the mood, character, and sense of setting he was trying to effect. Let's not forget, he *chose* the words to use.
--OR, we can assume that his great success and genius in painting vivid pictures with words was mere repetitive luck--"stepping in it" over and over and over...;-)