def sentence_precision(network_tags, gold_tags, gold_tag_dict, network_tag_dict):
    """
    Evaluates the network precision on a single sentence.
    
    :param network_tags: the answers by the network
    :param gold_tags: the correct tags
    :param gold_tag_dict: inverse tag dictionary (numbers to tags) for the
        gold tags.
    :param network_tag_dict: inverse tag dictionary (numbers to tags) for the
        network answers.
    :returns: a tuple where the first member is the list of arguments
        tagged right and the second is the list of arguments found by
        the network.
    """
    inside_argument = False
    mistake = False
    cur_tag = ''
    correct_args = []
    predicted_args = []
    
    for net_tag, gold_tag in izip(network_tags, gold_tags):
        net_tag = network_tag_dict[net_tag]
        gold_tag = gold_tag_dict[gold_tag]
        
        # argument boundary identification uses IOBES. Convert it to IOB
        # to make evaluation easier
        if net_tag == 'E':
            net_tag = 'I'
        elif net_tag == 'S':
            net_tag = 'B'
        
        if inside_argument or net_tag[0] != 'I':
            # last argument ended
            predicted_args.append(cur_tag)
            if not mistake and gold_tag[0] != 'I':
                correct_args.append(cur_tag)
            inside_argument = False
        
        if net_tag[0] == 'B' and net_tag != 'B-V':
            inside_argument = True
            mistake = False
            cur_tag = ''
            
            # let's see if it's actually an argument and not the verb
            if gold_tag == 'B-V':
                inside_argument = False
            elif gold_tag[0] != 'B':
                mistake = True
            
        elif net_tag[0] == 'I' and inside_argument:
            if not mistake and gold_tag[0] != 'I':
                mistake = True
    
    # if there was still an argument
    if inside_argument:
        predicted_args.append(cur_tag)
        if not mistake:
            correct_args.append(cur_tag)
        
    return (correct_args, predicted_args)
dataset/ETHPy150Open erickrf/nlpnet/bin/nlpnet-test.py/sentence_precision/operator `and` -> `or`