org.carrot2.clustering.lingo.ILabelAssigner Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of carrot2-mini Show documentation
Show all versions of carrot2-mini Show documentation
Carrot2 search results clustering framework. Minimal functional subset
(core algorithms and infrastructure, no document sources).
/*
* Carrot2 project.
*
* Copyright (C) 2002-2019, Dawid Weiss, Stanisław Osiński.
* All rights reserved.
*
* Refer to the full license file "carrot2.LICENSE"
* in the root folder of the repository checkout or at:
* http://www.carrot2.org/carrot2.LICENSE
*/
package org.carrot2.clustering.lingo;
import org.carrot2.mahout.math.matrix.DoubleMatrix2D;
import org.carrot2.text.preprocessing.PreprocessingContext;
import com.carrotsearch.hppc.IntIntHashMap;
/**
* Assigns labels to base vectors obtained from the factorization.
*/
public interface ILabelAssigner
{
/**
* Assigns labels to base vectors found by the matrix factorization. The results must
* be stored in the {@link LingoProcessingContext#clusterLabelFeatureIndex} and
* {@link LingoProcessingContext#clusterLabelScore} arrays.
*
* @param context contains all information about the current clustering request
* @param stemCos base vector -- single stems cosine matrix
* @param filteredRowToStemIndex mapping between row indices of stemCos and indices of
* stems in {@link PreprocessingContext#allStems}
* @param phraseCos base vector -- phrase cosine matrix
*/
public void assignLabels(LingoProcessingContext context, DoubleMatrix2D stemCos,
final IntIntHashMap filteredRowToStemIndex, DoubleMatrix2D phraseCos);
}