Documentation of 'com.datumbox.framework.applications.nlp.TextClassifier' Java class
TextClassifier
com.datumbox.framework.applications.nlp

Class TextClassifier

  • All Implemented Interfaces:
    Savable, Parallelizable, Trainable<Modeler.ModelParameters,Modeler.TrainingParameters>, java.lang.AutoCloseable


    public class TextClassifier
    extends Modeler
    TextClassifier is a convenience class which can be used to train Text ClassificationMetrics models. It is a wrapper class which automatically takes care of the text parsing, tokenization, feature selection and modeler training processes. It takes as input either a Dataframe object or multiple text files (one for each category) with one observation per row.
    • Method Detail

      • fit

        public void fit(java.util.Map<java.lang.Object,java.net.URI> datasets)
        Trains a Machine Learning modeler using the provided dataset files. The data map should have as index the names of each class and as values the URIs of the training files. The training files should contain one training example per row.
        Parameters:
        datasets -
      • predict

        public Dataframe predict(java.net.URI datasetURI)
        Generates a Dataframe with the predictions for the provided data file. The data file should contain the text of one observation per row.
        Parameters:
        datasetURI -
        Returns:
      • predict

        public Record predict(java.lang.String text)
        It generates a prediction for a particular string. It returns a Record object which contains the observation data, the predicted class and probabilities.
        Parameters:
        text -
        Returns:
      • validate

        public ClassificationMetrics validate(Dataframe testDataset)
        It validates the modeler using the provided dataset and it returns the ClassificationMetrics. The testDataset should contain the real target variables.
        Parameters:
        testDataset -
        Returns:
      • validate

        public ClassificationMetrics validate(java.util.Map<java.lang.Object,java.net.URI> datasets)
        It validates the modeler using the provided dataset files. The data map should have as index the names of each class and as values the URIs of the training files. The data files should contain one example per row.
        Parameters:
        datasets -
        Returns:

DataMelt 3.0 © DataMelt by jWork.ORG

Ads help maintain this website.