f4275c0b80197e0f1bbd3a2a1a31cf07d85013b1,scripts/word_embeddings/evaluate_pretrained.py,,,#,173

Before Change



    // Load pre-trained embeddings
    if not args_.embedding_path:
        if args_.embedding_name.lower() == "fasttext":
            token_embedding_ = nlp.embedding.create(
                args_.embedding_name,
                source=args_.embedding_source,
                load_ngrams=args_.fasttext_load_ngrams,
                allow_extend=True,
                unknown_autoextend=True)
        else:
            token_embedding_ = nlp.embedding.create(
                args_.embedding_name, source=args_.embedding_source)
        name = "-" + args_.embedding_name + "-" + args_.embedding_source
    else:
        token_embedding_ = load_embedding_from_path(args_)
        name = ""

After Change


            else:
                tokens.update(token_embedding_.idx_to_token)
        vocab = nlp.Vocab(nlp.data.count_tokens(tokens))
        with utils.print_time("set {} embeddings".format(len(tokens))):
            vocab.set_embedding(token_embedding_)
        evaluation.evaluate_analogy(
            args_, vocab.embedding, ctx, logfile=os.path.join(
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: dmlc/gluon-nlp
Commit Name: f4275c0b80197e0f1bbd3a2a1a31cf07d85013b1
Time: 2019-01-09
Author: leonard@lausen.nl
File Name: scripts/word_embeddings/evaluate_pretrained.py
Class Name:
Method Name:


Project Name: NervanaSystems/nlp-architect
Commit Name: 8e098ed186cf0c62dd01e1a02fd63b7d00443d89
Time: 2018-05-09
Author: peter.izsak@intel.com
File Name: nlp_architect/utils/text.py
Class Name: SpacyTokenizer
Method Name: __init__


Project Name: NervanaSystems/nlp-architect
Commit Name: 82d819ee591297fc5943a77315ddfd22f2d320a5
Time: 2018-05-10
Author: peter.izsak@intel.com
File Name: nlp_architect/utils/text.py
Class Name: SpacyInstance
Method Name: __init__