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

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
All Implemented Interfaces:
VectorFactoryContainer, LocalTermWeighter, CloneableSerializable, Serializable, Cloneable
Direct Known Subclasses:
NormalizedLogLocalTermWeighter

@PublicationReference(author="Susan T. Dumais",
                      title="Improving the retrieval of information from external sources",
                      year=1991,
                      type=Journal,
                      publication="Behavior Research Methods, Instruments, and Computers",
                      pages={229,236},
                      url="http://www.google.com/url?sa=t&source=web&ct=res&cd=1&url=http%3A%2F%2Fwww.psychonomic.org%2Fsearch%2Fview.cgi%3Fid%3D5145&ei=o7joSdGEHY-itgPLre3tAQ&usg=AFQjCNEvm6PZEL6_Hk3XThI6DQ-gGx9EnQ&sig2=-gjFzNroJQirwGtwjaJvgQ")
public class LogLocalTermWeighter
extends AbstractLocalTermWeighter

Implements the log-based local term weighting scheme. Takes in a vector of term counts and for positive entries, it makes the weight log(1 + count). 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
LogLocalTermWeighter()
          Creates a new LogLocalTermWeighter.
LogLocalTermWeighter(VectorFactory<? extends Vector> vectorFactory)
          Creates a new LogLocalTermWeighter.
 
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

LogLocalTermWeighter

public LogLocalTermWeighter()
Creates a new LogLocalTermWeighter.


LogLocalTermWeighter

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

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.

Parameters:
counts - The document to compute local weights for.
Returns:
The local weight vector for the documents.