Class StanfordMovieReview

  • All Implemented Interfaces:
    ai.djl.training.dataset.Dataset

    public class StanfordMovieReview
    extends TextDataset
    The StanfordMovieReview dataset contains a Application.NLP.SENTIMENT_ANALYSIS set of movie reviews and their sentiment ratings.

    The data is sourced from reviews located on IMDB (see here for details).

    • Constructor Detail

      • StanfordMovieReview

        protected StanfordMovieReview​(StanfordMovieReview.Builder builder)
        Creates a new instance of StanfordMovieReview with the given necessary configurations.
        Parameters:
        builder - a builder with the necessary configurations
    • Method Detail

      • prepare

        public void prepare​(ai.djl.util.Progress progress)
                     throws java.io.IOException,
                            ai.djl.modality.nlp.embedding.EmbeddingException
        Throws:
        java.io.IOException
        ai.djl.modality.nlp.embedding.EmbeddingException
      • get

        public ai.djl.training.dataset.Record get​(ai.djl.ndarray.NDManager manager,
                                                  long index)
        Specified by:
        get in class ai.djl.training.dataset.RandomAccessDataset
      • availableSize

        protected long availableSize()
        Specified by:
        availableSize in class ai.djl.training.dataset.RandomAccessDataset