'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'

def __init__(self, sentences, sentence_text, nsamples, nwords, max_len=100, index_from=2):

    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
    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)
    if extra_sent:
        source = source[:(- extra_sent)]
        source_text = source_text[:(- extra_sent)]
    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
    self.dev_X = self.be.iobuf(self.max_len, dtype=np.int32)
    self.X_np = np.empty((self.max_len, self.be.bsz), dtype=np.int32)
    self.shape = (self.max_len, 1)
