031a862a68853167c1be5aa971563f6069fd6d4d,nltk/translate/gleu_score.py,,sentence_gleu,#Any#Any#Any#Any#,16

Before Change


    
    // For each order of ngram, calculate the no. of ngram matches and
    // keep track of no. of ngram in references.
    ref_ngrams = Counter(everygrams(reference, min_len, max_len))
    hyp_ngrams = Counter(everygrams(hypothesis, min_len, max_len))
    overlap_ngrams = ref_ngrams & hyp_ngrams
    tp = sum(overlap_ngrams.values()) // True positives.
    tpfp = sum(hyp_ngrams.values()) // True positives + False positives.
    tpfn = sum(ref_ngrams.values()) // True positives + False negatives.

After Change


    

    // compatibility with previous single-reference API:
    if not references or isinstance(references[0], string_types):
        references = [references]

    return corpus_gleu(
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: nltk/nltk
Commit Name: 031a862a68853167c1be5aa971563f6069fd6d4d
Time: 2017-04-13
Author: goodman.m.w@gmail.com
File Name: nltk/translate/gleu_score.py
Class Name:
Method Name: sentence_gleu


Project Name: codelucas/newspaper
Commit Name: 5d6cdbd53544d057a1cf344526ec70e0995b77d1
Time: 2014-12-17
Author: lucasyangpersonal@gmail.com
File Name: newspaper/nlp.py
Class Name:
Method Name: keywords


Project Name: home-assistant/home-assistant
Commit Name: d6abdc0d4efa8386e549a9c8bbacc52bf5c82f7e
Time: 2016-04-08
Author: jaharkes@cs.cmu.edu
File Name: homeassistant/util/yaml.py
Class Name:
Method Name: _ordered_dict