bc6e778bc0523f463ae17ffe6f32ce2c3ff4e7b4,pytext/data/test/tensorizers_test.py,TensorizersTest,test_create_byte_tensors,#TensorizersTest#,73

Before Change



        s1 = "I want some coffee"
        s2 = "Turn it up"
        rows = [{"text": types.Text(s1)}, {"text": types.Text(s2)}]
        expected = [[ord(c) for c in s1], [ord(c) for c in s2]]

        tensors = (tensorizer.numberize(row) for row in rows)

After Change



        s1 = "I want some coffee"
        s2 = "Turn it up"
        s3 = "我不会说中文"
        rows = [{"text": s1}, {"text": s2}, {"text": s3}]
        expected = [list(s1.encode()), list(s2.encode()), list(s3.encode())]

        tensors = [tensorizer.numberize(row) for row in rows]
        self.assertEqual([(bytes, len(bytes)) for bytes in expected], tensors)

    def test_create_word_character_tensors(self):
        tensorizer = WordCharacterTensorizer(text_column="text")
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: facebookresearch/pytext
Commit Name: bc6e778bc0523f463ae17ffe6f32ce2c3ff4e7b4
Time: 2019-03-12
Author: snl@fb.com
File Name: pytext/data/test/tensorizers_test.py
Class Name: TensorizersTest
Method Name: test_create_byte_tensors


Project Name: CellProfiler/CellProfiler
Commit Name: c402572627812ef17bdda31c027cd24159ac73ee
Time: 2012-12-13
Author: leek@broadinstitute.org
File Name: cellprofiler/modules/run_imagej.py
Class Name: RunImageJ
Method Name: create_settings


Project Name: estnltk/estnltk
Commit Name: 158e4cb12d7ab478ea230e099a18644b2ac2bd17
Time: 2015-07-01
Author: tpetmanson@gmail.com
File Name: estnltk/corpus.py
Class Name:
Method Name: read_json_corpus