All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.carrot2.clustering.lingo.ILabelAssigner Maven / Gradle / Ivy

Go to download

Carrot2 search results clustering framework. Minimal functional subset (core algorithms and infrastructure, no document sources).

There is a newer version: 3.16.3
Show newest version

/*
 * 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);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy