Package ai.djl.huggingface.translator
Class SparseRetrievalTranslator.Builder
java.lang.Object
ai.djl.huggingface.translator.SparseRetrievalTranslator.Builder
- Enclosing class:
- SparseRetrievalTranslator
The builder for question answering translator.
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds the translator.voidConfigures the builder with the model arguments.optReturnDenseEmbedding(boolean returnDenseEmbedding) Sets if apply sigmoid for theTranslator.optSparseLinear(String sparseLinear) Sets the sparse linear layer model file for theTranslator.
-
Method Details
-
optReturnDenseEmbedding
Sets if apply sigmoid for theTranslator.- Parameters:
returnDenseEmbedding- true to output dense embedding- Returns:
- this builder
-
optSparseLinear
Sets the sparse linear layer model file for theTranslator.- Parameters:
sparseLinear- path to sparse linear layer model file- Returns:
- this builder
-
configure
Configures the builder with the model arguments.- Parameters:
arguments- the model arguments
-
build
Builds the translator.- Returns:
- the new translator
- Throws:
IOException- if I/O error occurs
-