gov.sandia.cognition.text.term.vector.weighter.local
Class NormalizedLogLocalTermWeighter

java.lang.Object
  extended by gov.sandia.cognition.util.AbstractCloneableSerializable
      extended by gov.sandia.cognition.math.matrix.DefaultVectorFactoryContainer
          extended by gov.sandia.cognition.text.term.vector.weighter.local.AbstractLocalTermWeighter
              extended by gov.sandia.cognition.text.term.vector.weighter.local.LogLocalTermWeighter
                  extended by gov.sandia.cognition.text.term.vector.weighter.local.NormalizedLogLocalTermWeighter
All Implemented Interfaces:
VectorFactoryContainer, LocalTermWeighter, CloneableSerializable, Serializable, Cloneable

@PublicationReference(author={"Erica Chisholm","Tamara G. Kolda"},
                      title="New Term Weighting Formulas for the Vector Space Method in Information Retrieval",
                      type=TechnicalReport,
                      url="http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.40.3899",
                      year=1999,
                      notes="We use a slight modification of the formula for normalizing in this paper.")
public class NormalizedLogLocalTermWeighter
extends LogLocalTermWeighter

Implements a normalized version of the log local weighter. It is similar to the LogLocalWeighter except that it normalizes by the average frequency. It takes in a vector of term counts and for positive entries, it makes the weight log(1 + count) / log(1 + average) where average is the average count across the whole document. Counts of zero (or less) are weighted as zero.

Since:
3.0
Author:
Justin Basilico
See Also:
Serialized Form

Field Summary
 
Fields inherited from class gov.sandia.cognition.math.matrix.DefaultVectorFactoryContainer
vectorFactory
 
Constructor Summary
NormalizedLogLocalTermWeighter()
          Creates a new NormalizedLogLocalTermWeighter.
NormalizedLogLocalTermWeighter(VectorFactory<? extends Vector> vectorFactory)
          Creates a new NormalizedLogLocalTermWeighter
 
Method Summary
 Vector computeLocalWeights(Vector counts)
          Computes the new local weights for a given document.
 
Methods inherited from class gov.sandia.cognition.text.term.vector.weighter.local.AbstractLocalTermWeighter
computeLocalWeights
 
Methods inherited from class gov.sandia.cognition.math.matrix.DefaultVectorFactoryContainer
getVectorFactory, setVectorFactory
 
Methods inherited from class gov.sandia.cognition.util.AbstractCloneableSerializable
clone
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface gov.sandia.cognition.util.CloneableSerializable
clone
 

Constructor Detail

NormalizedLogLocalTermWeighter

public NormalizedLogLocalTermWeighter()
Creates a new NormalizedLogLocalTermWeighter.


NormalizedLogLocalTermWeighter

public NormalizedLogLocalTermWeighter(VectorFactory<? extends Vector> vectorFactory)
Creates a new NormalizedLogLocalTermWeighter

Parameters:
vectorFactory - The vector factory to use.
Method Detail

computeLocalWeights

public Vector computeLocalWeights(Vector counts)
Description copied from interface: LocalTermWeighter
Computes the new local weights for a given document.

Specified by:
computeLocalWeights in interface LocalTermWeighter
Overrides:
computeLocalWeights in class LogLocalTermWeighter
Parameters:
counts - The document to compute local weights for.
Returns:
The local weight vector for the documents.