4d8cca40654deb641809bf8fb376afd9b1633d52,nlp_architect/data/cdc_resources/gen_scripts/create_word_embed_glove_dump.py,,load_glove_for_vocab,#Any#Any#,39

Before Change


    glove_file.close()

    embeddings = np.asarray(embd, dtype=float)
    word_to_ix = {}
    for word in vocab:
        word_to_ix[word] = len(word_to_ix)

    return word_to_ix, embeddings

After Change


    logger.info("Loaded GloVe!")

    embeddings = np.asarray(embd, dtype=float)
    word_to_ix = {word: i for i, word in enumerate(vocab)}
    return word_to_ix, embeddings

Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: NervanaSystems/nlp-architect
Commit Name: 4d8cca40654deb641809bf8fb376afd9b1633d52
Time: 2019-03-31
Author: daniel.korat@intel.com
File Name: nlp_architect/data/cdc_resources/gen_scripts/create_word_embed_glove_dump.py
Class Name:
Method Name: load_glove_for_vocab


Project Name: Hironsan/anago
Commit Name: 0c0b8a1f0bd4940b1f0d700074280396764f23ae
Time: 2018-05-29
Author: hiroki.nakayama.py@gmail.com
File Name: anago/utils.py
Class Name: Vocabulary
Method Name: __init__


Project Name: AKSHAYUBHAT/DeepVideoAnalytics
Commit Name: 277cdc5c3315a7419af76c0ef17628d99b98a1cd
Time: 2018-05-31
Author: akshayubhat@gmail.com
File Name: server/dvaapp/task_handlers.py
Class Name:
Method Name: handle_perform_analysis