Hey Drew, I'm not much of a maven guy - what's the maven-foo you use to get this running?
Jake, my mistake, I should have included updated docs when I updated the patch.
I eliminated the code to read plain text files from a directory, so you would need to begin by producing a SequenceFile<Text,Text> (document id, document) as input. Robin's utility in mahout-examples, o.a.m.text.SequenceFilesFromDirectory can do this. Run the following from the 'examples' directory;
mvn -e exec:java -Dexec.mainClass="org.apache.mahout.text.SequenceFilesFromDirectory" -Dexec.args="--parent (...input directory..) --outputDir (..output directory..) --charset UTF-8"
Once you have the sequence file to use as input, run the following from the 'examples' directory as well.
mvn -e exec:java -Dexec.mainClass="org.apache.mahout.nlp.collocations.llr.CollocDriver" -Dexec.args="--input (..path-to-input..) --output (..path-to-output..) -w"
Once the driver class is run, the collocations will be in (output-directory)/colloc/part-00000 as plaintext. They can be sorted by LLR score using the same sort command I included in the previous comment above (I have a question about this below).
FWIW, I need to re-submit the patch to clean up some of the pom changes to
MAHOUT-215 were applied.
A couple follow up questions while you're looking at this:
Currently I just dump the results of the second pass to a file, not sorted by LLR score. I could sort by LLR by sending it through another pass with an identity mapper and a reducer but I suspect that's probably pretty inefficient. Is there a better way to sort the output of the second pass by LLR?
If I only wanted to emit the top 1-10% of the collocs (user configurable), how would I tell the reducer to stop emitting results at a certain point (or is yet another pass needed to achieve something like this?)
Would it be better to emit a sequencefile<LongWritable,Text> instead of a text file as the output from the final pass?