Package ai.djl.modality.nlp.translator
Class QATranslator.BaseBuilder<T extends QATranslator.BaseBuilder>
java.lang.Object
ai.djl.modality.nlp.translator.QATranslator.BaseBuilder<T>
- Enclosing class:
- QATranslator
public abstract static class QATranslator.BaseBuilder<T extends QATranslator.BaseBuilder>
extends Object
The builder for question answering translator.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Configures the builder with the model arguments.optBatchifier
(Batchifier batchifier) Sets theBatchifier
for theTranslator
.optIncludeTokenTypes
(boolean includeTokenTypes) Sets the if include token types for theTranslator
.Sets the name of the locale for theTranslator
.optMaxLabels
(int maxLabels) Sets the max number of labels for theTranslator
.optMaxLength
(int maxLength) Sets the max number of tokens for theTranslator
.optPadding
(boolean padding) Sets the if pad the tokens for theTranslator
.optTokenizer
(String tokenizer) Sets the name of the tokenizer for theTranslator
.optToLowerCase
(boolean toLowerCase) Sets the if convert text to lower case for theTranslator
.optTruncation
(boolean truncation) Sets the if truncate the tokens for theTranslator
.Sets the name of the vocabulary file for theTranslator
.protected abstract T
self()
-
Constructor Details
-
BaseBuilder
public BaseBuilder()
-
-
Method Details
-
optBatchifier
Sets theBatchifier
for theTranslator
.- Parameters:
batchifier
- theBatchifier
to be set- Returns:
- this builder
-
optTokenizer
Sets the name of the tokenizer for theTranslator
.- Parameters:
tokenizer
- the name of the tokenizer- Returns:
- this builder
-
optVocab
Sets the name of the vocabulary file for theTranslator
.- Parameters:
vocab
- name of the vocabulary file- Returns:
- this builder
-
optLocale
Sets the name of the locale for theTranslator
.- Parameters:
locale
- the name of the locale- Returns:
- this builder
-
optToLowerCase
Sets the if convert text to lower case for theTranslator
.- Parameters:
toLowerCase
- if convert text to lower case- Returns:
- this builder
-
optIncludeTokenTypes
Sets the if include token types for theTranslator
.- Parameters:
includeTokenTypes
- if include token types- Returns:
- this builder
-
optPadding
Sets the if pad the tokens for theTranslator
.- Parameters:
padding
- if pad the tokens- Returns:
- this builder
-
optTruncation
Sets the if truncate the tokens for theTranslator
.- Parameters:
truncation
- if truncate the tokens- Returns:
- this builder
-
optMaxLength
Sets the max number of tokens for theTranslator
.- Parameters:
maxLength
- the max number of tokens- Returns:
- this builder
-
optMaxLabels
Sets the max number of labels for theTranslator
.- Parameters:
maxLabels
- the max number of labels- Returns:
- this builder
-
configure
Configures the builder with the model arguments.- Parameters:
arguments
- the model arguments
-
self
-