03b0e7061cf477fbeccb9c128ee76603df582d86,scripts/word_embeddings/evaluate_pretrained.py,,,#,159

Before Change


        token_embedding = load_embedding_from_path(args_)
        name = ""

    if args_.max_vocab_size:
        if args_.embedding_path and ".bin" in args_.embedding_path:
            raise NotImplementedError(
                "Not implemented for binary fastText model.")

        size = min(len(token_embedding._idx_to_token), args_.max_vocab_size)
        token_embedding._idx_to_token = token_embedding._idx_to_token[:size]
        token_embedding._idx_to_vec = token_embedding._idx_to_vec[:size]
        token_embedding._token_to_idx = {
            token: idx
            for idx, token in enumerate(token_embedding._idx_to_token)
        }

    similarity_results = evaluation.evaluate_similarity(
        args_, token_embedding, ctx, logfile=os.path.join(
            args_.logdir, "similarity{}.tsv".format(name)))
    analogy_results = evaluation.evaluate_analogy(

After Change


        name = ""

    enforce_max_size(token_embedding_, args_.max_vocab_size)
    known_tokens = set(token_embedding_.idx_to_token)
    // Auto-extend token_embedding with unknown extra eval tokens
    if token_embedding_.unknown_lookup is not None:
        eval_tokens = evaluation.get_tokens_in_evaluation_datasets(args_)
        // pylint: disable=pointless-statement
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


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: keras-team/keras
Commit Name: e6c3f77b0b10b0d76778109a40d6d3282f1cadd0
Time: 2018-02-07
Author: francois.chollet@gmail.com
File Name: keras/callbacks.py
Class Name: ProgbarLogger
Method Name: __init__


Project Name: ray-project/ray
Commit Name: f2408b719c991b98ba5dc77db81dc184805b33df
Time: 2020-09-17
Author: weepingwillowben@gmail.com
File Name: rllib/env/pettingzoo_env.py
Class Name: PettingZooEnv
Method Name: step