Class FillMaskTranslator.Builder

java.lang.Object
ai.djl.huggingface.translator.FillMaskTranslator.Builder
Enclosing class:
FillMaskTranslator

public static final class FillMaskTranslator.Builder extends Object
The builder for fill mask translator.
  • Method Details

    • optMaskToken

      public FillMaskTranslator.Builder optMaskToken(String maskedToken)
      Sets the id of the mask Translator.
      Parameters:
      maskedToken - the id of the mask
      Returns:
      this builder
    • optTopK

      public FillMaskTranslator.Builder optTopK(int topK)
      Set the topK number of classes to be displayed.
      Parameters:
      topK - the number of top classes to return
      Returns:
      this builder
    • optIncludeTokenTypes

      public FillMaskTranslator.Builder optIncludeTokenTypes(boolean includeTokenTypes)
      Sets if include token types for the Translator.
      Parameters:
      includeTokenTypes - true to include token types
      Returns:
      this builder
    • optBatchifier

      public FillMaskTranslator.Builder optBatchifier(ai.djl.translate.Batchifier batchifier)
      Sets the Batchifier for the Translator.
      Parameters:
      batchifier - true to include token types
      Returns:
      this builder
    • configure

      public void configure(Map<String,?> arguments)
      Configures the builder with the model arguments.
      Parameters:
      arguments - the model arguments
    • build

      public FillMaskTranslator build() throws IOException
      Builds the translator.
      Returns:
      the new translator
      Throws:
      IOException - if I/O error occurs