HomeSort by relevance Sort by last modified time
    Searched refs:word2index (Results 1 - 3 of 3) sorted by null

  /external/tensorflow/tensorflow/contrib/eager/python/examples/spinn/
data_test.py 149 word2index, embed = data.load_word_vectors(self._temp_data_dir, vocab)
151 self.assertEqual(6, len(word2index))
152 self.assertEqual(0, word2index["<unk>"])
153 self.assertEqual(1, word2index["<pad>"])
154 self.assertEqual(2, word2index["."])
155 self.assertEqual(3, word2index["foo"])
156 self.assertEqual(4, word2index["bar"])
157 self.assertEqual(5, word2index["baz"])
226 word2index, _ = data.load_word_vectors(self._temp_data_dir, vocab)
233 word_indices, shift_reduce = data.encode_sentence(sentence, word2index)
    [all...]
data.py 165 1. word2index: A dict from lower-case word to row index in the embedding
182 word2index = dict()
187 word2index["<unk>"] = UNK_CODE
188 word2index["<pad>"] = PAD_CODE
194 if word in vocab and word not in word2index:
195 word2index[word] = len(embed)
200 return word2index, embed
230 def encode_sentence(sentence, word2index):
237 word2index: A `dict` mapping words to their word indices.
248 [[word2index.get(word, UNK_CODE) for word in words]]).
    [all...]
spinn_test.py 364 word2index, embed = data.load_word_vectors(self._temp_data_dir, vocab)
371 embed, word2index, None, None, None, config)
380 word2index, embed = data.load_word_vectors(self._temp_data_dir, vocab)
387 spinn.train_or_infer_spinn(embed, word2index, None, None, None, config)
397 word2index, embed = data.load_word_vectors(self._temp_data_dir, vocab)
399 train_data = data.SnliData(fake_train_file, word2index)
400 dev_data = data.SnliData(fake_train_file, word2index)
401 test_data = data.SnliData(fake_train_file, word2index)
410 embed, word2index, train_data, dev_data, test_data, config)

Completed in 690 milliseconds