92788fb85bd840dcfe106f63600020420949b1b7,tests/preprocess_test.py,WordPreprocessorTest,test_unknown_word,#WordPreprocessorTest#,28

Before Change


        self.assertIsInstance(p.inverse_transform(y[0])[0], str)

    def test_unknown_word(self):
        train_dir = os.path.join(os.path.dirname(__file__), "../data/conll2003/en/")
        datasets = reader.read_data_sets(train_dir)
        X, y = datasets.train.sents, datasets.train.labels
        preprocessor = WordPreprocessor()
        p = preprocessor.fit(X, y)
        X = [["$unknownword$", "あ"]]
        y = [["O", "O"]]

After Change


        self.assertIsInstance(p.inverse_transform(y[0])[0], str)

    def test_unknown_word(self):
        X, y = reader.extract_data(self.filename)
        preprocessor = WordPreprocessor()
        p = preprocessor.fit(X, y)
        X = [["$unknownword$", "あ"]]
        y = [["O", "O"]]
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 18

Instances


Project Name: Hironsan/anago
Commit Name: 92788fb85bd840dcfe106f63600020420949b1b7
Time: 2017-08-15
Author: light.tree.1.13@gmail.com
File Name: tests/preprocess_test.py
Class Name: WordPreprocessorTest
Method Name: test_unknown_word


Project Name: Hironsan/anago
Commit Name: 92788fb85bd840dcfe106f63600020420949b1b7
Time: 2017-08-15
Author: light.tree.1.13@gmail.com
File Name: tests/preprocess_test.py
Class Name: WordPreprocessorTest
Method Name: test_unknown_word


Project Name: Hironsan/anago
Commit Name: 92788fb85bd840dcfe106f63600020420949b1b7
Time: 2017-08-15
Author: light.tree.1.13@gmail.com
File Name: tests/preprocess_test.py
Class Name: WordPreprocessorTest
Method Name: test_vocab_init


Project Name: Hironsan/anago
Commit Name: 92788fb85bd840dcfe106f63600020420949b1b7
Time: 2017-08-15
Author: light.tree.1.13@gmail.com
File Name: tests/preprocess_test.py
Class Name: WordPreprocessorTest
Method Name: test_preprocessor