def evaluate_srl_classify(no_repeat=False, gold_file=None):
    # load data
    md = Metadata.load_from_file('srl_classify')
    nn = taggers.load_network(md)
    r = taggers.create_reader(md, gold_file)
    r.create_converter()
    
    r.codify_sentences()
    hits = 0
    total_args = 0
    
    for sentence, tags, predicates, args in izip(r.sentences, r.tags, r.predicates, r.arg_limits):
        
        # the answer includes all predicates
        answer = nn.tag_sentence(sentence, predicates, args, allow_repeats=not no_repeat)
        
        for pred_answer, pred_gold in izip(answer, tags):
        
            for net_tag, gold_tag in izip(pred_answer, pred_gold):
                if net_tag == gold_tag:
                    hits += 1
            
            total_args += len(pred_gold)
    
    print('Accuracy: %f' % (float(hits) / total_args))
Evaluates the performance of the network on the SRL classifying task.
dataset/ETHPy150Open erickrf/nlpnet/bin/nlpnet-test.py/evaluate_srl_classify