(self, prob)
return sents
Convert 1 hot probabilities to sentences.

        Args:
            prob (Tensor): Word probabilities of each sentence of batch.
                           Of size (vocab_size, batch_size * (max_sentence_length+1))

        Returns:
            list containing sentences
Convert 1 hot probabilities to sentences.
Convert 1 hot probabilities to sentences .
def prob_to_word(self, prob):
        """
        Convert 1 hot probabilities to sentences.

        Args:
            prob (Tensor): Word probabilities of each sentence of batch.
                           Of size (vocab_size, batch_size * (max_sentence_length+1))

        Returns:
            list containing sentences
        """

        sents = []

        if not isinstance(prob, np.ndarray):
            prob = prob.get()
        words = [self.index_to_vocab[x] for x in np.argmax(prob, axis=0).tolist()]

        for sent_index in xrange(self.be.bsz):
            sent = []
            for i in xrange(self.max_sentence_length):
                word = words[self.be.bsz * i + sent_index]
                sent.append(word)
                if (i > 0 and word == self.end_token) or i >= 20:
                    break
            sents.append(" ".join(sent))

        return sents
def prob_to_word ( self , prob ) : sents = [ ] if not isinstance ( prob , np . ndarray ) : prob = prob . get ( ) words = [ self . index_to_vocab [ x ] for x in np . argmax ( prob , axis = 0 ) . tolist ( ) ] for sent_index in xrange ( self . be . bsz ) : sent = [ ] for i in xrange ( self . max_sentence_length ) : word = words [ self . be . bsz * i + sent_index ] sent . append ( word ) if ( i > 0 and word == self . end_token ) or i >= 20 : break sents . append ( " " . join ( sent ) ) return sents