1a8e10d0a88e25aa8b3ca9d7ea31225439d348a7,lexos/processors/analyze/topword.py,,analyze_para_to_group,#,136

Before Change


    assert np.size(words) > 0, EMPTY_NP_ARRAY_MESSAGE

    // initialize the value to return
    all_results = {}

    // find the total word count of each group
    group_lists = [np.sum(value, axis=0)
                   for _, value in enumerate(group_values)]

    // find number of groups
    num_group = len(group_lists)

    // comparison map, in here is a list of tuple.
    // There are two elements in the tuple, each one is a index of groups
    // (for example the first group will have index 0)
    // Two groups index cannot be equal.
    comp_map = itertools.product(list(range(num_group)),
                                 list(range(num_group)))
    comp_map = [(i_index, j_index)
                for (i_index, j_index) in comp_map if i_index != j_index]

    // compare each paragraph in group_comp to group_base
    for group_comp_index, group_base_index in comp_map:
        // gives all the paragraphs in the group in a array
        group_comp_paras = group_values[group_comp_index]
        // the word list of base group
        group_base_list = group_lists[group_base_index]

        // enumerate through all the paragraphs in group_comp_paras

        for para_index, paras in enumerate(group_comp_paras):
            word_z_score_dict = _z_test_word_list_(
                count_list_i=paras,
                count_list_j=group_base_list,
                words=words)

            // sort the dictionary

            // pack the sorted result in sorted list
            all_results.update(
                {(group_comp_index, para_index, group_base_index):
                     word_z_score_dict})

    return all_results

After Change


            for para_index, paras in enumerate(comp_para)]

        // generate header
        temp_header = ["Document "" + name_map[comp_index][para_index] +
                         "" compared to Class: " + class_labels[base_index]
                        for para_index, _ in enumerate(comp_para)]

        analysis_result += temp_analysis_result
        header_list += temp_header

    // put result together in a readable list
    readable_result = list(zip(header_list, analysis_result))

    return readable_result

Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 8

Instances


Project Name: WheatonCS/Lexos
Commit Name: 1a8e10d0a88e25aa8b3ca9d7ea31225439d348a7
Time: 2017-08-07
Author: weltch1997@gmail.com
File Name: lexos/processors/analyze/topword.py
Class Name:
Method Name: analyze_para_to_group


Project Name: WheatonCS/Lexos
Commit Name: d3fd161765b9c9652fab403bcc59fcbc8e40cfe9
Time: 2017-08-07
Author: weltch1997@gmail.com
File Name: lexos/processors/analyze/topword.py
Class Name:
Method Name: analyze_group_to_group


Project Name: explosion/spaCy
Commit Name: 925a852bb6450e16a23346e97a1813fc0fcb22a0
Time: 2019-08-01
Author: adrianeboyd@gmail.com
File Name: spacy/scorer.py
Class Name: Scorer
Method Name: score