org.carrot2.clustering.lingo
Class SimpleLabelAssigner

java.lang.Object
  extended by org.carrot2.clustering.lingo.SimpleLabelAssigner
All Implemented Interfaces:
ILabelAssigner

public class SimpleLabelAssigner
extends Object
implements ILabelAssigner

A simple and fast label assigner. For each base vector chooses the label that maximizes the base vector--label term vector cosine similarity. Different vectors can get the same label assigned, which means the number of final labels (after duplicate removal) may be smaller than the number of base vectors on input.

See Also:
UniqueLabelAssigner

Constructor Summary
SimpleLabelAssigner()
           
 
Method Summary
 void assignLabels(LingoProcessingContext context, org.apache.mahout.math.matrix.DoubleMatrix2D stemCos, com.carrotsearch.hppc.IntIntOpenHashMap filteredRowToStemIndex, org.apache.mahout.math.matrix.DoubleMatrix2D phraseCos)
          Assigns labels to base vectors found by the matrix factorization.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleLabelAssigner

public SimpleLabelAssigner()
Method Detail

assignLabels

public void assignLabels(LingoProcessingContext context,
                         org.apache.mahout.math.matrix.DoubleMatrix2D stemCos,
                         com.carrotsearch.hppc.IntIntOpenHashMap filteredRowToStemIndex,
                         org.apache.mahout.math.matrix.DoubleMatrix2D phraseCos)
Description copied from interface: ILabelAssigner
Assigns labels to base vectors found by the matrix factorization. The results must be stored in the LingoProcessingContext.clusterLabelFeatureIndex and LingoProcessingContext.clusterLabelScore arrays.

Specified by:
assignLabels in interface ILabelAssigner
Parameters:
context - contains all information about the current clustering request
stemCos - base vector -- single stems cosine matrix
filteredRowToStemIndex - mapping between row indices of stemCos and indices of stems in PreprocessingContext.allStems
phraseCos - base vector -- phrase cosine matrix


Copyright (c) Dawid Weiss, Stanislaw Osinski