

def evaluate_srl_identify(gold_file):
    '\n    Evaluates the performance of the network on the SRL task for the \n    argument boundaries identification subtask\n    '
    md = Metadata.load_from_file('srl_boundary')
    nn = taggers.load_network(md)
    srl_reader = taggers.create_reader(md, gold_file=gold_file)
    net_itd = srl_reader.get_inverse_tag_dictionary()
    srl_reader.load_tag_dict(config.FILES['srl_tags'], iob=True)
    srl_reader.convert_tags('iob', update_tag_dict=False)
    gold_itd = srl_reader.get_inverse_tag_dictionary()
    counter_predicted_args = Counter()
    counter_existing_args = Counter()
    counter_correct_args = Counter()
    srl_reader.codify_sentences()
    for (sent, preds, sent_tags) in izip(sent_tags.sentences, srl_reader.predicates, srl_reader.tags):
        answers = nn.tag_sentence(sent, preds)
        for (answer, tags) in zip(answers, sent_tags):
            (correct_args, existing_args) = sentence_recall(answer, tags, gold_itd, net_itd)
            counter_correct_args.update(correct_args)
            counter_existing_args.update(existing_args)
            (_, predicted_args) = sentence_precision(answer, tags, gold_itd, net_itd)
            counter_predicted_args.update(predicted_args)
    correct_args = sum(counter_correct_args.values())
    total_args = sum(counter_existing_args.values())
    total_found_args = sum(counter_predicted_args.values())
    rec = (correct_args / float(total_args))
    prec = (correct_args / float(total_found_args))
    try:
        f1 = (((2 * rec) * prec) / (rec + prec))
    except ZeroDivisionError:
        f1 = 0
    print(('Recall: %f, Precision: %f, F-1: %f' % (rec, prec, f1)))
    print()
    print('Argument\tRecall')
    for arg in counter_existing_args:
        rec = (counter_correct_args[arg] / float(counter_existing_args[arg]))
        print(('%s\t\t%f' % (arg, rec)))

dataset/ETHPy150Open erickrf/nlpnet/bin/nlpnet-test.py evaluate_srl_identify/VarMisuse@121/247 `srl_reader`->`sent_tags`