b89d94957773d49908829272f8c1ac98c6031243,models/lemma/data.py,DataLoader,init_vocab,#DataLoader#Any#,53

Before Change


    def init_vocab(self, data):
        assert self.eval == False, "Vocab file must exist for evaluation"
        chars = "".join([d[0] + d[2] for d in data])
        char_counter = Counter(chars)
        vocab = Vocab(unit_counter=char_counter)
        poss = [d[1] for d in data]
        poss_counter = Counter(poss)
        pos_vocab = Vocab(unit_counter=poss_counter)
        return vocab, pos_vocab

After Change


    def init_vocab(self, data):
        assert self.eval == False, "Vocab file must exist for evaluation"
        char_data = "".join(d[0] + d[2] for d in data)
        char_vocab = Vocab(None, char_data, self.args["lang"])
        pos_data = [d[1] for d in data]
        pos_vocab = Vocab(None, pos_data, self.args["lang"])
        return char_vocab, pos_vocab
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: stanfordnlp/stanza
Commit Name: b89d94957773d49908829272f8c1ac98c6031243
Time: 2018-10-22
Author: zyh@stanford.edu
File Name: models/lemma/data.py
Class Name: DataLoader
Method Name: init_vocab


Project Name: pytorch/text
Commit Name: 7bc693102a5394bb73b3df2320fca5a35bebc91f
Time: 2017-09-11
Author: nfliu@cs.washington.edu
File Name: test/test_vocab.py
Class Name: TestVocab
Method Name: test_vocab


Project Name: dmlc/gluon-nlp
Commit Name: b810d10386fad58bded6b39b233f5009406f6da3
Time: 2019-09-11
Author: lausen@amazon.com
File Name: scripts/word_embeddings/evaluate_pretrained.py
Class Name:
Method Name: