gov.llnl.ontology.mapreduce.stats
Class DependencyOccurrenceCountMR

java.lang.Object
  extended by org.apache.hadoop.conf.Configured
      extended by gov.llnl.ontology.mapreduce.CorpusTableMR
          extended by gov.llnl.ontology.mapreduce.stats.DependencyOccurrenceCountMR
All Implemented Interfaces:
org.apache.hadoop.conf.Configurable, org.apache.hadoop.util.Tool

public class DependencyOccurrenceCountMR
extends CorpusTableMR

A MapReduce task that counts the number of co-occurrences in a sentence that are connected by a valid DependencyPath. Paths will be validated by both their length and a DependencyPathAcceptor. The final word in each path, and, optionally, the final relation may be included, as the co-occurrence feature. This mapper pairs with the WordCountSumReducer.

Author:
Keith Stevens

Nested Class Summary
static class DependencyOccurrenceCountMR.DependencyOccurrenceCountMapper
          Iterates through each DependencyTreeNode and finds all valid paths from that node to other nodes in the sentence.
 
Nested classes/interfaces inherited from class gov.llnl.ontology.mapreduce.CorpusTableMR
CorpusTableMR.CorpusTableMapper<K,V>
 
Field Summary
static String ABOUT
          The about string.
static String CONF_PREFIX
          A prefix for any Configuration setting.
static String DEFAULT_ACCEPTOR
          The classname of the default DependencyPathAcceptor.
static String PATH_ACCEPTOR
          The configuration for setting the DependencyPathAcceptor.
static String PATH_LENGTH
          The configuration for setting the path length.
static String USE_RELATION
          The configuration for setting whether or not relations should be in the co-occurrence features.
 
Fields inherited from class gov.llnl.ontology.mapreduce.CorpusTableMR
TABLE
 
Constructor Summary
DependencyOccurrenceCountMR()
           
 
Method Summary
protected  void addOptions(MRArgOptions options)
          Add more command line arguments.
protected  String jobName()
          Returns a descriptive job name for this map reduce task.
static void main(String[] args)
          Runs the DependencyOccurrenceCountMR.
protected  Class mapperClass()
          Returns the Class object for the Mapper task.
protected  Class mapperKeyClass()
          Returns the Class object for the Mapper Value of this task.
protected  Class mapperValueClass()
          Returns the Class object for the Mapper Value of this task.
protected  void setupConfiguration(MRArgOptions options, org.apache.hadoop.conf.Configuration conf)
          Copies command line arguments to a Configuration so that Map/Reduce jobs can utilize the values set.
protected  void setupReducer(String tableName, org.apache.hadoop.mapreduce.Job job, MRArgOptions options)
          Sets up the Reducer for this job.
protected  void validateOptions(MRArgOptions options)
          Returns true if the MRArgOptions contains a valid value for each requried option.
 
Methods inherited from class gov.llnl.ontology.mapreduce.CorpusTableMR
run
 
Methods inherited from class org.apache.hadoop.conf.Configured
getConf, setConf
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.hadoop.conf.Configurable
getConf, setConf
 

Field Detail

ABOUT

public static final String ABOUT
The about string.

See Also:
Constant Field Values

CONF_PREFIX

public static final String CONF_PREFIX
A prefix for any Configuration setting.

See Also:
Constant Field Values

PATH_ACCEPTOR

public static final String PATH_ACCEPTOR
The configuration for setting the DependencyPathAcceptor.

See Also:
Constant Field Values

PATH_LENGTH

public static final String PATH_LENGTH
The configuration for setting the path length.

See Also:
Constant Field Values

USE_RELATION

public static final String USE_RELATION
The configuration for setting whether or not relations should be in the co-occurrence features.

See Also:
Constant Field Values

DEFAULT_ACCEPTOR

public static final String DEFAULT_ACCEPTOR
The classname of the default DependencyPathAcceptor.

See Also:
Constant Field Values
Constructor Detail

DependencyOccurrenceCountMR

public DependencyOccurrenceCountMR()
Method Detail

main

public static void main(String[] args)
                 throws Exception
Runs the DependencyOccurrenceCountMR.

Throws:
Exception

jobName

protected String jobName()
Returns a descriptive job name for this map reduce task.

Overrides:
jobName in class CorpusTableMR

addOptions

protected void addOptions(MRArgOptions options)
Add more command line arguments. By default, this adds no options.

Overrides:
addOptions in class CorpusTableMR

validateOptions

protected void validateOptions(MRArgOptions options)
Returns true if the MRArgOptions contains a valid value for each requried option. By default, this does no validation.

Overrides:
validateOptions in class CorpusTableMR

setupConfiguration

protected void setupConfiguration(MRArgOptions options,
                                  org.apache.hadoop.conf.Configuration conf)
Copies command line arguments to a Configuration so that Map/Reduce jobs can utilize the values set. By default, this does no configuration.

Overrides:
setupConfiguration in class CorpusTableMR

mapperClass

protected Class mapperClass()
Returns the Class object for the Mapper task.

Specified by:
mapperClass in class CorpusTableMR

mapperKeyClass

protected Class mapperKeyClass()
Returns the Class object for the Mapper Value of this task.

Overrides:
mapperKeyClass in class CorpusTableMR

mapperValueClass

protected Class mapperValueClass()
Returns the Class object for the Mapper Value of this task.

Overrides:
mapperValueClass in class CorpusTableMR

setupReducer

protected void setupReducer(String tableName,
                            org.apache.hadoop.mapreduce.Job job,
                            MRArgOptions options)
Sets up the Reducer for this job.

Overrides:
setupReducer in class CorpusTableMR


Copyright © 2010-2011. All Rights Reserved.