Package ai.djl.huggingface.translator
Class TokenClassificationTranslator.Builder
java.lang.Object
ai.djl.huggingface.translator.TokenClassificationTranslator.Builder
- Enclosing class:
- TokenClassificationTranslator
The builder for token classification translator.
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds the translator.voidConfigures the builder with the model arguments.optBatchifier(ai.djl.translate.Batchifier batchifier) Sets theBatchifierfor theTranslator.optIncludeTokenTypes(boolean includeTokenTypes) Sets if include token types for theTranslator.optSoftmax(boolean softmax) Sets if implement softmax operation for theTranslator.
-
Method Details
-
optIncludeTokenTypes
Sets if include token types for theTranslator.- Parameters:
includeTokenTypes- true to include token types- Returns:
- this builder
-
optSoftmax
Sets if implement softmax operation for theTranslator.- Parameters:
softmax- true to implement softmax to model output result- Returns:
- this builder
-
optBatchifier
Sets theBatchifierfor theTranslator.- Parameters:
batchifier- true to include token types- 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
-