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

Before Change


    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


def glove_dump():
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

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: PetrochukM/PyTorch-NLP
Commit Name: bb9335bbc981c0541e37a875d79d0ef419008574
Time: 2018-03-25
Author: petrochukm@gmail.com
File Name: torchnlp/text_encoders/subword_encoder.py
Class Name: SubwordEncoder
Method Name: __init__


Project Name: NervanaSystems/coach
Commit Name: b1e9ea48d86807382c5feca0d18a6bf71f5caa03
Time: 2019-01-03
Author: gouravr@amazon.com
File Name: rl_coach/architectures/tensorflow_components/savers.py
Class Name: GlobalVariableSaver
Method Name: restore