def ComputeErrorRates(label_counts, word_counts, seq_errors, num_seqs):
 label_errors = (label_counts.fn + label_counts.fp)
 num_labels = (label_counts.truth_count + label_counts.test_count)
 return ErrorRates(ComputeErrorRate(label_errors, num_labels), ComputeErrorRate(word_counts.fn, word_counts.truth_count), ComputeErrorRate(word_counts.fp, word_counts.test_count), ComputeErrorRate(seq_errors, num_seqs))

def ComputeErrorRates ( label_counts , word_counts , seq_errors , num_seqs ) : label_errors = ( label_counts . fn + label_counts . fp ) num_labels = ( label_counts . truth_count + label_counts . test_count ) return ErrorRates ( ComputeErrorRate ( label_errors , num_labels ) , ComputeErrorRate ( word_counts . fn , word_counts . truth_count ) , ComputeErrorRate ( word_counts . fp , word_counts . test_count ) , ComputeErrorRate ( seq_errors , num_seqs ) )
returns an errorrates corresponding to the given counts .