413567b74a552a66d93bca09fe82dd52e4d4e90f,nlp_architect/utils/metrics.py,,get_conll_scores,#Any#Any#Any#,66

Before Change


    temp_fname = tempfile.gettempdir() + \
        os.sep + \
        "".join([random.choice(string.ascii_letters) for _ in range(10)]) + "__conll_eval"
    with open(temp_fname, "w") as fp:
        for sample in prediction_data:
            for t, l, p in zip(*sample):
                fp.write("{} - {} {}\n".format(t, l, p))
            fp.write("\n")

    // run CoNLL benchmark
    scores = run_conlleval(temp_fname)
    os.remove(temp_fname)
    return scores

After Change


                prediction_y[i] = y_lex[j]
        prediction_data.append((test_yval, test_yval, prediction_y))

    data = []
    for s in prediction_data:
        for t, l, p in zip(*s):
            data.append("{} {} {}\n".format(t, l, p))
        data.append("\n")
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: NervanaSystems/nlp-architect
Commit Name: 413567b74a552a66d93bca09fe82dd52e4d4e90f
Time: 2018-05-09
Author: peter.izsak@intel.com
File Name: nlp_architect/utils/metrics.py
Class Name:
Method Name: get_conll_scores


Project Name: hanxiao/bert-as-service
Commit Name: 76a51d48d12544a96421235573420230bd7a7e4a
Time: 2018-12-05
Author: hanhxiao@tencent.com
File Name: server/setup.py
Class Name:
Method Name:


Project Name: PetrochukM/PyTorch-NLP
Commit Name: eb61fee854576c8a57fd9a20ee03b6fcb89c493a
Time: 2019-05-16
Author: petrochukm@gmail.com
File Name: torchnlp/download.py
Class Name:
Method Name: _maybe_extract