Package org.carrot2.text.vsm
Class LogTfIdfTermWeighting
java.lang.Object
org.carrot2.attrs.AttrComposite
org.carrot2.text.vsm.LogTfIdfTermWeighting
- All Implemented Interfaces:
AcceptingVisitor
,TermWeighting
public class LogTfIdfTermWeighting extends AttrComposite implements TermWeighting
Calculates term-document matrix element values based on Log Inverse Term Frequency.
-
Field Summary
-
Constructor Summary
Constructors Constructor Description LogTfIdfTermWeighting()
-
Method Summary
Modifier and Type Method Description double
calculateTermWeight(int termFrequency, int documentFrequency, int documentCount)
Calculates the weight of a term for a single document.
-
Constructor Details
-
LogTfIdfTermWeighting
public LogTfIdfTermWeighting()
-
-
Method Details
-
calculateTermWeight
public double calculateTermWeight(int termFrequency, int documentFrequency, int documentCount)Description copied from interface:TermWeighting
Calculates the weight of a term for a single document.- Specified by:
calculateTermWeight
in interfaceTermWeighting
- Parameters:
termFrequency
- frequency of the term in the documentdocumentFrequency
- the number of documents containing the termdocumentCount
- total number of documents
-