Package ai.djl.basicdataset.utils
Class TextData.Configuration
java.lang.Object
ai.djl.basicdataset.utils.TextData.Configuration
- Enclosing class:
- TextData
The configuration for creating a
TextData value in a Dataset.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionsetEmbeddingSize(int embeddingSize) Sets the size for newTextEmbeddings.setReservedTokens(List<String> reservedTokens) Sets the list of reserved tokens.setTextEmbedding(ai.djl.modality.nlp.embedding.TextEmbedding textEmbedding) Sets theTextEmbeddingto use to embed the text data.setTextProcessors(List<ai.djl.modality.nlp.preprocess.TextProcessor> textProcessors) Sets theTextProcessors to use for the text data.setUnknownToken(String unknownToken) Sets the default unknown token.setVocabulary(ai.djl.modality.nlp.Vocabulary vocabulary) Sets theVocabularyto use to hold the text data.update(TextData.Configuration other) Updates thisTextData.Configurationwith the non-null values from another configuration.
-
Constructor Details
-
Configuration
public Configuration()
-
-
Method Details
-
setTextProcessors
public TextData.Configuration setTextProcessors(List<ai.djl.modality.nlp.preprocess.TextProcessor> textProcessors) Sets theTextProcessors to use for the text data.- Parameters:
textProcessors- theTextProcessors- Returns:
- this configuration
-
setTextEmbedding
public TextData.Configuration setTextEmbedding(ai.djl.modality.nlp.embedding.TextEmbedding textEmbedding) Sets theTextEmbeddingto use to embed the text data.- Parameters:
textEmbedding- theTextEmbedding- Returns:
- this configuration
-
setVocabulary
Sets theVocabularyto use to hold the text data.- Parameters:
vocabulary- theVocabulary- Returns:
- this configuration
-
setEmbeddingSize
Sets the size for newTextEmbeddings.- Parameters:
embeddingSize- the embedding size- Returns:
- this configuration
-
setUnknownToken
Sets the default unknown token.- Parameters:
unknownToken- theStringvalue of unknown token- Returns:
- this configuration
-
setReservedTokens
Sets the list of reserved tokens.- Parameters:
reservedTokens- true to train the text embedding- Returns:
- this configuration
-
update
Updates thisTextData.Configurationwith the non-null values from another configuration.- Parameters:
other- the other configuration to use to update this- Returns:
- this configuration after updating
-