Interface Classifier<T>

    • Method Detail

      • assignClass

        ClassificationResult<T> assignClass​(java.lang.String text)
                                     throws java.io.IOException
        Assign a class (with score) to the given text String
        Parameters:
        text - a String containing text to be classified
        Returns:
        a ClassificationResult holding assigned class of type T and score
        Throws:
        java.io.IOException - If there is a low-level I/O error.
      • getClasses

        java.util.List<ClassificationResult<T>> getClasses​(java.lang.String text)
                                                    throws java.io.IOException
        Get all the classes (sorted by score, descending) assigned to the given text String.
        Parameters:
        text - a String containing text to be classified
        Returns:
        the whole list of ClassificationResult, the classes and scores. Returns null if the classifier can't make lists.
        Throws:
        java.io.IOException - If there is a low-level I/O error.
      • getClasses

        java.util.List<ClassificationResult<T>> getClasses​(java.lang.String text,
                                                           int max)
                                                    throws java.io.IOException
        Get the first max classes (sorted by score, descending) assigned to the given text String.
        Parameters:
        text - a String containing text to be classified
        max - the number of return list elements
        Returns:
        the whole list of ClassificationResult, the classes and scores. Cut for "max" number of elements. Returns null if the classifier can't make lists.
        Throws:
        java.io.IOException - If there is a low-level I/O error.