Class TextPrompt

java.lang.Object
ai.djl.modality.nlp.TextPrompt

public final class TextPrompt extends Object
The input container for NLP text prompt.
  • Method Details

    • isBatch

      public boolean isBatch()
      Returns if the prompt is a batch.
      Returns:
      true if the prompt is a batch
    • getText

      public String getText()
      Returns the single prompt.
      Returns:
      the single prompt
    • getBatch

      public List<String> getBatch()
      Returns the batch prompt.
      Returns:
      the batch prompt
    • parseInput

      public static TextPrompt parseInput(Input input) throws TranslateException
      Returns the TextPrompt from the Input.
      Parameters:
      input - the input object
      Returns:
      the TextPrompt from the Input
      Throws:
      TranslateException - if the input is invalid