4965b77c43be657cb00905122046bb1da3ce664a,matchzoo/processor_units/processor_units.py,WordHashingUnit,transform,#WordHashingUnit#Any#,432

Before Change


        :return: Word hashing representation of `tri-letters`.
        
        hashing = np.zeros((len(letters), len(self._term_index) + 1))
        for idx in range(len(letters)):
            counted_letters = collections.Counter(letters[idx])
            for key, value in counted_letters.items():
                letter_id = self._term_index.get(key, 0)
                hashing[idx, letter_id] = value
        return hashing


class SumRepresentUnit(ProcessorUnit):

After Change


        // the input shape for DSSM model [ngram, ngram, ...]
        if isinstance(letters[0], str):
            hashing = np.zeros((len(self._term_index) + 1))
            counted_letters = collections.Counter(letters)
            for key, value in counted_letters.items():
                letter_id = self._term_index.get(key, 0)
                hashing[letter_id] = value
        else:
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: NTMC-Community/MatchZoo
Commit Name: 4965b77c43be657cb00905122046bb1da3ce664a
Time: 2019-01-04
Author: 948280670@qq.com
File Name: matchzoo/processor_units/processor_units.py
Class Name: WordHashingUnit
Method Name: transform


Project Name: NTMC-Community/MatchZoo
Commit Name: 4bc0cb5d2924a63cf06f641b7cf36f799885f33f
Time: 2018-12-26
Author: 948280670@qq.com
File Name: matchzoo/processor_units/processor_units.py
Class Name: WordHashingUnit
Method Name: transform


Project Name: OpenNMT/OpenNMT-py
Commit Name: d556116728d4f505eb14be081f29e32212145725
Time: 2017-09-01
Author: bpeters@coli.uni-saarland.de
File Name: onmt/IO.py
Class Name:
Method Name: merge_vocabs