def evaluate_pos(gold_file=None, oov=None):
    md = Metadata.load_from_file('pos')
    nn = taggers.load_network(md)
    pos_reader = taggers.create_reader(md, gold_file=gold_file)
    itd = pos_reader.get_inverse_tag_dictionary()
    
    logger = logging.getLogger("Logger")
    logger.debug('Loaded network')
    logger.debug(nn.description())
    logger.info('Starting test...')
    hits = 0
    total = 0
    
    for sent in pos_reader.sentences:
        
        tokens, tags = zip(*sent)
        sent_codified = pos_reader.codify_sentence(tokens)
        answer = nn.tag_sentence(sent_codified)
        if oov is not None:
            iter_sent = iter(tokens)
                
        for net_tag, gold_tag in zip(answer, tags):
            
            if oov is not None:
                # only check oov words
                word = iter_sent.next()
                if word.lower() not in oov:
                    continue
            
            if itd[net_tag] == gold_tag:
                hits += 1
            
            total += 1
        
    print('%d hits out of %d' % (hits, total))
    accuracy = float(hits) / total
    print('Accuracy: %f%%' % (100 * accuracy))
Disables cloud monitoring for a node
dataset/ETHPy150Open erickrf/nlpnet/bin/nlpnet-test.py/evaluate_pos--crossover with--dataset/ETHPy150Open apache/libcloud/libcloud/compute/drivers/dimensiondata.py/DimensionDataNodeDriver.ex_disable_monitoring