Interface TextClassifier<E extends Enum<E>>

Type Parameters:
E - Enum that is the result of classification.
All Known Implementing Classes:
EmbeddingModelTextClassifier

public interface TextClassifier<E extends Enum<E>>
Classifies given text according to specified enum.
  • Method Summary

    Modifier and Type
    Method
    Description
    default List<E>
    classify(dev.langchain4j.data.document.Document document)
    Classify the given Document.
    default List<E>
    classify(dev.langchain4j.data.segment.TextSegment textSegment)
    Classify the given TextSegment.
    Classify the given text.
  • Method Details

    • classify

      List<E> classify(String text)
      Classify the given text.
      Parameters:
      text - Text to classify.
      Returns:
      A list of classification categories.
    • classify

      default List<E> classify(dev.langchain4j.data.segment.TextSegment textSegment)
      Classify the given TextSegment.
      Parameters:
      textSegment - TextSegment to classify.
      Returns:
      A list of classification categories.
    • classify

      default List<E> classify(dev.langchain4j.data.document.Document document)
      Classify the given Document.
      Parameters:
      document - Document to classify.
      Returns:
      A list of classification categories.