Class SparseRetrievalTranslator.Builder

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

public static final class SparseRetrievalTranslator.Builder extends Object
The builder for question answering translator.
  • Method Details

    • optReturnDenseEmbedding

      public SparseRetrievalTranslator.Builder optReturnDenseEmbedding(boolean returnDenseEmbedding)
      Sets if apply sigmoid for the Translator.
      Parameters:
      returnDenseEmbedding - true to output dense embedding
      Returns:
      this builder
    • optSparseLinear

      public SparseRetrievalTranslator.Builder optSparseLinear(String sparseLinear)
      Sets the sparse linear layer model file for the Translator.
      Parameters:
      sparseLinear - path to sparse linear layer model file
      Returns:
      this builder
    • configure

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

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