def nbest_best_sentence(nbest, n=None):
    """Find and return the sentence with the lowest WER in the n-best list."""
    sentences = nbest.sentences
    if n:
        sentences = sentences[:n]
    return min(sentences, key=lambda x: x.wer())
