CompLearn Example: A Study in Rhetoric

The following example examines some of the most noteworthy public addresses made by American political figures. The text of these speeches are also included with the software.

Step 1: Create a Distance Matrix

$ ncd -b -d examples/speeches examples/speeches

This creates a square distance matrix using the speech texts in the examples/speeches directory of the CompLearn distribution. With the -b option, a binary file called distmatrix.clb will be created by default. The results of this command are also output to stdout.

Step 2: Generate a Tree

$ maketree distmatrix.clb

Here, we use the previously created distance matrix to create an unrooted binary tree. The resulting tree is output as a .dot file called treefile.dot by default. The contents of the resulting .dot file describe how the nodes of the tree are connected and how they are labeled. Please note: because we are generating a tree from a 18x18 matrix, maketree may take several minutes to complete. However, feel free to take a peek at treefile.dot while it is still in progress.

Step 3: Lay Out Your Tree

$ neato -Tps -Gsize=7,7 treefile.dot > speeches-unrooted.ps

This neato command will create a visual representation of your tree in postscript format. This particular postscript file is laid out on a 7x7 inch drawing area.

If instead you prefer a browser-compatible format, such as .png you can use the following command.

$ neato -Tpng treefile.dot > speeches-unrooted.png

neato supports other popular formats such as .jpg and .gif.

Step 4: Analyze Your Results

The results may be surprising to some, as one would expect the deliverers of these famous addresses to cluster together. Rather, context appears to be the underlying factor in this small example. As you can see, speeches which refer to great tragedies in American history occupy their own branch, John F. Kennedy's civil rights address is quite close to Martin Luther King, Jr's own civil rights speech, and texts that call for action, such as Reagan's 1st Inaugural, JFK's Cuban Missile Crisis address, and Malcom X's "Ballot or Bullet" speech cluster together as well.