Information about the DAL Ajax Application

Overview

This demo uses Cynthia Whissell's Dictionary of Affective Language. Although this work is not released (Its copyright was bought by an outside party), Cynthia Whissell has graciously given me access to the raw form of the dictionary (I believe there's a free-to-use program that analyzes text using the DAL--most likely from the previously mentioned outside party--but this only runs on windows and has a somewhat limited scope).

In the spirit of sharing, I'd like to allow other people to use my derived work, while still respecting the wishes of Prof. Whissell and the owners of the intellectual property of her work. The web application demo uses an Ajax framework that reads the dictionary on my server and returns xml that can be used to make an application similar to the one you can see here.

How it works

The sentence is simply queried for each word using the GET method (POST will also work):
http://compling.org/cgi-bin/DAL_sentence_xml.cgi?sentence=these+are+the+words


The returned xml will look like this:


<sentence>
    <word>
        <token>these</token>
	<emotion>
            <measure type="DAL" valence="1.5000" activation="1.6667" imagery="1.0"/>
        </emotion>
    </word>
    <word>
        <token>are</token>
	<emotion>
            <measure type="DAL" valence="1.6667" activation="1.6667" imagery="1.0"/>
        </emotion>
    </word>
    <word>
        <token>the</token>
	<emotion>
            <measure type="DAL" valence="1.7500" activation="1.1667" imagery="1.0"/>
        </emotion>
    </word>
    <word>
        <token>words</token>
	<emotion>
            <measure type="DAL" valence="1.8571" activation="1.1667" imagery="2.2"/>
        </emotion>
    </word>
</sentence>

You can see the javascript code by viewing the source of the above link. The webservice that returns the xml is on my home computer which I run as a server. It is up fairly regularly, but don't count on it for, say, an important demo. I'm going to update the program and hopefully get a linux computer for use on campus that will have a faster pipe and more reliable up time.

The sentence is passed to the cgi program, which normalizes the text (removes puntuation), looks up each word in Whissell's DAL, and returns the value for each dimension. If a word is not there, it will return the midpoint for that word. The web page uses javascript/DOM to get the DAL values from the xml and then scales the colors (now just linearly) from red/rgb(0,0,255) (-valence) to blue/rgb(255,0,0) (+valence) and from 20pt (-activation) to 40pt (+activation) font.

To Do


Last modified: Tue Jun 19 18:07:25 PDT 2007