82bf45a64f0a431fa2ab1611abdbe9a135bcabd7,opennmt/tests/inputter_test.py,InputterTest,testCharConvEmbedder,#InputterTest#,237
Before Change
self.assertAllEqual([2, 2], transformed[0][1])
def testCharConvEmbedder(self):
vocab_file = os.path.join(self.get_temp_dir(), "vocab.txt")
data_file = os.path.join(self.get_temp_dir(), "data.txt")
with io.open(vocab_file, encoding="utf-8", mode="w") as vocab:
vocab.write(u"h\n"
u"e\n"
u"l\n"
u"w\n"
u"o\n")
with io.open(data_file, encoding="utf-8", mode="w") as data:
data.write(u"hello world !\n")
embedder = text_inputter.CharConvEmbedder("vocabulary_file", 10, 5)
features, transformed = self._makeDataset(
embedder,
data_file,
After Change
self.assertAllEqual([2, 2], transformed[0][1])
def testCharConvEmbedder(self):
vocab_file = self._makeTextFile("vocab.txt", ["h", "e", "l", "w", "o"])
data_file = self._makeTextFile("data.txt", ["hello world !"])
embedder = text_inputter.CharConvEmbedder("vocabulary_file", 10, 5)
features, transformed = self._makeDataset(
embedder,
In pattern: SUPERPATTERN
Frequency: 5
Non-data size: 24
Instances
Project Name: OpenNMT/OpenNMT-tf
Commit Name: 82bf45a64f0a431fa2ab1611abdbe9a135bcabd7
Time: 2019-01-12
Author: guillaume.klein@systrangroup.com
File Name: opennmt/tests/inputter_test.py
Class Name: InputterTest
Method Name: testCharConvEmbedder
Project Name: OpenNMT/OpenNMT-tf
Commit Name: 82bf45a64f0a431fa2ab1611abdbe9a135bcabd7
Time: 2019-01-12
Author: guillaume.klein@systrangroup.com
File Name: opennmt/tests/inputter_test.py
Class Name: InputterTest
Method Name: testMixedInputter
Project Name: OpenNMT/OpenNMT-tf
Commit Name: 82bf45a64f0a431fa2ab1611abdbe9a135bcabd7
Time: 2019-01-12
Author: guillaume.klein@systrangroup.com
File Name: opennmt/tests/inputter_test.py
Class Name: InputterTest
Method Name: testWordEmbedderWithPretrainedEmbeddings
Project Name: OpenNMT/OpenNMT-tf
Commit Name: 82bf45a64f0a431fa2ab1611abdbe9a135bcabd7
Time: 2019-01-12
Author: guillaume.klein@systrangroup.com
File Name: opennmt/tests/inputter_test.py
Class Name: InputterTest
Method Name: testCharConvEmbedder
Project Name: OpenNMT/OpenNMT-tf
Commit Name: 82bf45a64f0a431fa2ab1611abdbe9a135bcabd7
Time: 2019-01-12
Author: guillaume.klein@systrangroup.com
File Name: opennmt/tests/inputter_test.py
Class Name: InputterTest
Method Name: testParallelInputter
Project Name: OpenNMT/OpenNMT-tf
Commit Name: 82bf45a64f0a431fa2ab1611abdbe9a135bcabd7
Time: 2019-01-12
Author: guillaume.klein@systrangroup.com
File Name: opennmt/tests/inputter_test.py
Class Name: InputterTest
Method Name: testWordEmbedder