Corpus

The Compass corpus consists of 130 documents from 15 authors drawn from articles published the The Compass Newspaper of Lake Superior State University during the 2006-07 school year. The corpus is broken into two pieces:

Compass.300+
69 Documents
300 - 500 Words Each

Compass.500+
61 Documents
500+ Words

2008-01-18: One of the authors represented in this corpus has asked that I remove their name from the files. In light of this, I have removed the corpora until I can strip out the author names.

Corpus Construction Scripts

extract_text.pl
Uses the Win32::OLE module to suck the text out of Word documents (.doc and .rtf files, only).
The $word, $text, and $ext variables declared at the top of the scipt can be used to change where it gets files, where it puts them, and what extension is gives them.
NOTE: This script WILL NOT work on non-Windows platforms. It requires both Microsoft Word and the OLE interface provided by Windows.

xmlify.pl
Takes text files and adds the XML formatting required by the feature extractor. DocID is automatically set to the original file name. AuthorID is always left blank. The script assumes exactly one document per file, and skips any file without a .txt extension
The $text and $xml variables at the top of the script control source and destination locations. Any document shorter than $minsize is skipped.

cleanup.pl
Strips out all of the blank lines out of the files supplied at the command line. Can accept any number of files to work on.

Author ID

build_sets.pl
Takes a list of files containing one or more XML-formatted documents each and splits the documents into training and testing sets using a supplied training/test split ratio. Outputs one file with the training set, and a second with the testing set.

build_sets_from_features.pl
Same as above, except that it expects the input files to contain BMR-ready feature vectors, rather than XML-formatted documents.

analyze_model.pl
Given a BMR model and lists of feature/author id codes, returns the user specified number of most important features for each author in the model.

run_test_set.pl
Automates the process of running an Author ID test by gathering information from the user and then automagically generating a training/test split, passing it through the feature extractor, training a model, classifying the docs in the test set, and extracting info on the most important features for each author in the model.

Common Author

find_distances_features.pl
Takes a cleaned set of BMR-ready feature vectors (That is, just the vectors, no comments or blank lines) and computes the dot product and Euclidean distance between each distinct pair of vectors. Output is written to a .pair_data file, and includes whether the two docs are written by the same author, their doc and author ids, and the calculated values.
This script can handle arbirarily large number of vectors, which in turn contain arbitrarily large numbers of features, memory permitting, though it is not exactly speedly on large datasets.

find_distances_class.pl
Same as above, except that it expects vectors of class probabilities (formatted like the output of the -r switch of BMRclassify) rather than feature vectors.

calculate_roc.cpp
C++ source code for a program which accepts a list of .pair_data files output from either of the above Perl scripts and returns the area under the ROC curve produced by sorting the pairs descending by dot product and ascending by Euclidean distance.
The program uses merge sort on a linked list to deal with the data, and is known to work on data sets with more than 2.7 million sets of vector pair data.

Weka -> BMR Conversion

weka2bmr.pl
Receives a single Weka-formated .arff feature vector file and converts it for use by BMR/BXR. By default, feature names specified in the Weka file are lost because BMR requires numeric feature names. Since BXR supports named features, adding the BXR switch on the command line will cause Weka vector names to be preserved in the output file.

Complete Data

bonamy_data.tar.bz2
This compressed archive includes all of the above scripts and data, plus all of the test sets I have created through July 26, 2007. Also included are some Debian Linux binaries of various programs, including the calculate_roc sotware about. The organizational system is, perhaps, not optimal, but everything is there.
NOTE: While the bz2 file is only about 180MB, the extracted set of the data is 780MB.