class_docstr: This class defines an iterator for loading and iterating the sentences in
  a structure to encode sentences into the skip-thought vectors
class_docstr_tok: ["This","class","defines","an","iterator","for","loading","and","iterating","the","sentences","in","a","structure","to","encode","sentences","into","the","skip-thought","vectors"]
docstr: Construct a sentence dataset object.
  Build the context using skip-thought model
  
  Aguments:
      sentences: list of tokenized (and int-encoded) sentences to use for iteration
      sentence_text: list of raw text sentences
      nsamples: number of sentences
      nwords: number of words in vocab
docstr_tok: ["Construct","a","sentence","dataset","object",".","Build","the","context","using","skip-thought","model","Aguments",":","sentences",":","list","of","tokenized","(","and","int-encoded",")","sentences","to","use","for","iteration","sentence_text",":","list","of","raw","text","sentences","nsamples",":","number","of","sentences","nwords",":","number","of","words","in","vocab"]
code: def __init__(
      self,
      sentences,
      sentence_text,
      nsamples,
      nwords,
      max_len=100,
      index_from=2,
  ):
      """
      Construct a sentence dataset object.
      Build the context using skip-thought model
  
      Aguments:
          sentences: list of tokenized (and int-encoded) sentences to use for iteration
          sentence_text: list of raw text sentences
          nsamples: number of sentences
          nwords: number of words in vocab
      """
      super(SentenceEncode, self).__init__(name=None)
      self.nsamples = nsamples
      self.nwords = nwords
      self.batch_index = 0
      self.nbatches = 0
      self.max_len = max_len
      self.index_from = index_from
  
      # group the sentences to triplets
      source = sentences[:nsamples]
      source_text = sentence_text[:nsamples]
      extra_sent = len(source) % self.be.bsz
  
      self.nbatches = len(source) // self.be.bsz
      self.ndata = self.nbatches * self.be.bsz  # no leftovers
  
      if extra_sent:
          source = source[:-extra_sent]
          source_text = source_text[:-extra_sent]
  
      # get sentence length stats based on the input sentence length
      self.sent_len = dict(
          (i, min(len(c), self.max_len)) for i, c in enumerate(source)
      )
  
      self.X = source
      self.X_text = source_text
  
      # inputs using embeddings
      self.dev_X = self.be.iobuf(self.max_len, dtype=np.int32)
      # the np array to put noncontiguous data in. use for entire minibatch
      self.X_np = np.empty((self.max_len, self.be.bsz), dtype=np.int32)
  
      self.shape = (self.max_len, 1)
  
file_path: neon/examples/skip-thought/data_iterator.py
imports: from __future__ import division
  import numpy
  import h5py
  import copy
  from neon.data.dataiterator import NervanaDataIterator
label_desc: Use image node_id 1 to create a new SentenceEncode object from inherited base classes: NervanaDataIterator with example: obj = SentenceEncode(sentences, sentence_text, nsamples, nwords, max_len, index_from)