Class TextDataset.Builder<T extends TextDataset.Builder<T>>

java.lang.Object
ai.djl.training.dataset.RandomAccessDataset.BaseBuilder<T>
ai.djl.basicdataset.nlp.TextDataset.Builder<T>
Direct Known Subclasses:
GoEmotions.Builder, PennTreebankText.Builder, StanfordMovieReview.Builder, StanfordQuestionAnsweringDataset.Builder, TatoebaEnglishFrenchDataset.Builder, UniversalDependenciesEnglishEWT.Builder
Enclosing class:
TextDataset

public abstract static class TextDataset.Builder<T extends TextDataset.Builder<T>> extends ai.djl.training.dataset.RandomAccessDataset.BaseBuilder<T>
Abstract Builder that helps build a TextDataset.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected String
     
    protected String
     
    protected ai.djl.repository.Repository
     
    protected ai.djl.training.dataset.Dataset.Usage
     

    Fields inherited from class ai.djl.training.dataset.RandomAccessDataset.BaseBuilder

    dataBatchifier, device, labelBatchifier, limit, pipeline, prefetchNumber, sampler, targetPipeline
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    Constructs a new builder.
  • Method Summary

    Modifier and Type
    Method
    Description
    optArtifactId(String artifactId)
    Sets the optional artifactId.
    optGroupId(String groupId)
    Sets optional groupId.
    optManager(ai.djl.ndarray.NDManager manager)
    Sets the optional manager for the dataset (default follows engine default).
    optRepository(ai.djl.repository.Repository repository)
    Sets the optional repository.
    optUsage(ai.djl.training.dataset.Dataset.Usage usage)
    Sets the optional usage.
    Sets the TextData.Configuration to use for the source text data.
    Sets the TextData.Configuration to use for the target text data.

    Methods inherited from class ai.djl.training.dataset.RandomAccessDataset.BaseBuilder

    addTargetTransform, addTransform, getSampler, optDataBatchifier, optDevice, optLabelBatchifier, optLimit, optPipeline, optPrefetchNumber, optTargetPipeline, self, setSampling, setSampling, setSampling

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • repository

      protected ai.djl.repository.Repository repository
    • groupId

      protected String groupId
    • artifactId

      protected String artifactId
    • usage

      protected ai.djl.training.dataset.Dataset.Usage usage
  • Constructor Details

    • Builder

      protected Builder()
      Constructs a new builder.
  • Method Details

    • setSourceConfiguration

      public T setSourceConfiguration(TextData.Configuration sourceConfiguration)
      Sets the TextData.Configuration to use for the source text data.
      Parameters:
      sourceConfiguration - the TextData.Configuration
      Returns:
      this builder
    • setTargetConfiguration

      public T setTargetConfiguration(TextData.Configuration targetConfiguration)
      Sets the TextData.Configuration to use for the target text data.
      Parameters:
      targetConfiguration - the TextData.Configuration
      Returns:
      this builder
    • optManager

      public T optManager(ai.djl.ndarray.NDManager manager)
      Sets the optional manager for the dataset (default follows engine default).
      Parameters:
      manager - the manager
      Returns:
      this builder
    • optUsage

      public T optUsage(ai.djl.training.dataset.Dataset.Usage usage)
      Sets the optional usage.
      Parameters:
      usage - the usage
      Returns:
      this builder
    • optRepository

      public T optRepository(ai.djl.repository.Repository repository)
      Sets the optional repository.
      Parameters:
      repository - the repository
      Returns:
      this builder
    • optGroupId

      public T optGroupId(String groupId)
      Sets optional groupId.
      Parameters:
      groupId - the groupId}
      Returns:
      this builder
    • optArtifactId

      public T optArtifactId(String artifactId)
      Sets the optional artifactId.
      Parameters:
      artifactId - the artifactId
      Returns:
      this builder