

def evaluate_srl_1step(find_preds_automatically=False, gold_file=None):
    '\n    Evaluates the network on the SRL task performed with one step for\n    id + class.\n    '
    md = Metadata.load_from_file('srl')
    nn = taggers.load_network(md)
    r = taggers.create_reader(md, gold_file=gold_file)
    itd = r.get_inverse_tag_dictionary()
    if find_preds_automatically:
        tagger = taggers.SRLTagger()
    else:
        iter_predicates = iter(r.predicates)
    for sent in iter(r.sentences):
        actual_sent = sent[0]
        if find_preds_automatically:
            pred_positions = tagger.find_predicates(sent)
        else:
            pred_positions = iter_predicates.next()
        verbs = [(position, actual_sent[position].word) for position in pred_positions]
        sent_codified = np.array([r.converter.convert(token) for token in actual_sent])
        answers = nn.tag_sentence(sent_codified, pred_positions)
        tags = [convert_iob_to_iobes([itd[x] for x in pred_answer]) for pred_answer in answers]
        print(prop_conll(token, tags, len(actual_sent)))

dataset/ETHPy150Open erickrf/nlpnet/bin/nlpnet-test.py evaluate_srl_1step/VarMisuse@210/355 `verbs`->`token`