[docs]classLevenshtein:"""levenshtein distance returns number of deletions, insertions, or substitutions required to convert source string into target string. Parameters ---------- source, target : str Returns ------- distance : int number of deletions, insertions, or substitutions required to convert source into target. """
[docs]classCharacterErrorRate:"""Levenshtein edit distance normalized by length of true sequence. Also known as word error distance; here applied to other vocalizations in addition to speech. Parameters ---------- y_pred : str predicted labels for a series of songbird syllables y_true : str ground truth labels for a series of songbird syllables Returns ------- Levenshtein distance(y_pred, y_true) / len(y_true) """