def displayFirstNExamples(self, n):
        if 0 < self.src_window:
            return
        src_vocab, src_vocab_size = io_vocab.load_vocab(self.src_vocab_file)
        tgt_vocab, tgt_vocab_size = io_vocab.load_vocab(self.tgt_vocab_file)
        src_inverse_vocab = io_vocab.inverse_vocab(src_vocab)
        tgt_inverse_vocab = io_vocab.inverse_vocab(tgt_vocab)
        assert(n <= self.chunk_size)
        for i in xrange(n):
            example_x = self.data_x[i]
            example_y = self.data_y[i]
            sent_idx = example_x[-1]
            src_window_vector = example_x[:self.src_window*2 + 1]
            tgt_gram_vector = example_x[self.src_window*2 + 1:]
            src_window_words = io_vocab.getWordsFromIndeces(src_window_vector, src_inverse_vocab, self.tgt_vocab_size)
            tgt_gram_words = io_vocab.getWordsFromIndeces(tgt_gram_vector, tgt_inverse_vocab, 0)

            output = ""
            count = 0
            for w in src_window_words:
                count += 1
                if count == self.src_window + 1:
                    output += "[" + w + "] "
                else:
                    output += w + " "
            output += "|| "
            output += " ".join(tgt_gram_words) + " "
            output += "===> " + tgt_inverse_vocab[example_y]
            print output
dataset/ETHPy150Open yuhaozhang/nnjm-global/code/train_nnjm.py/TrainNNJMModel.displayFirstNExamples/swapped operands of `<`