693d7ba4f19678bd2d96af8ed78c3fde7b4990a1,scripts/word_embeddings/evaluate_pretrained.py,,load_embedding_from_path,#Any#,132

Before Change


            // Pre-compute all words in vocabulary in case of analogy evaluation
            idx_to_token = [
                model.token_to_idx[idx]
                for idx in range(len(model.token_to_idx))
            ]
            if args.max_vocab_size:
                idx_to_token = idx_to_token[:args.max_vocab_size]

After Change


        idx_to_token = sorted(model._token_to_idx, key=model._token_to_idx.get)
        if not args.analogy_datasets:
            // Prune tokens not used in evaluation datasets
            eval_tokens_ = set(
                evaluation.get_tokens_in_evaluation_datasets(args))
            idx_to_token = [t for t in idx_to_token if t in eval_tokens_]
        if args.max_vocab_size:
            idx_to_token = idx_to_token[:args.max_vocab_size]
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 4

Instances


Project Name: dmlc/gluon-nlp
Commit Name: 693d7ba4f19678bd2d96af8ed78c3fde7b4990a1
Time: 2018-11-23
Author: leonard@lausen.nl
File Name: scripts/word_embeddings/evaluate_pretrained.py
Class Name:
Method Name: load_embedding_from_path


Project Name: NifTK/NiftyNet
Commit Name: ab7c70b3d7e47d11375bc770617c8c073d65a5dd
Time: 2019-06-05
Author: thomas.varsavsky.15@ucl.ac.uk
File Name: niftynet/contrib/csv_reader/csv_reader.py
Class Name: CSVReader
Method Name: to_ohe


Project Name: dmlc/gluon-nlp
Commit Name: 03b0e7061cf477fbeccb9c128ee76603df582d86
Time: 2018-09-04
Author: leonard@lausen.nl
File Name: scripts/word_embeddings/evaluate_pretrained.py
Class Name:
Method Name:


Project Name: NifTK/NiftyNet
Commit Name: d9f34f7871d5f6a8109434c20f53ccb315ee33c1
Time: 2019-07-03
Author: thomas.varsavsky.15@ucl.ac.uk
File Name: niftynet/contrib/csv_reader/csv_reader.py
Class Name: CSVReader
Method Name: to_ohe