def word_error_rate(self, hypotheses: List[str], references: List[str]) -> float:
        """
        Computes Average Word Error rate between two texts represented as
        corresponding lists of string. Hypotheses and references must have same length.

        Args:
            hypotheses: list of hypotheses
            references: list of references

        Returns:
            (float) average word error rate
        """
        scores = 0
        words = 0
        if len(hypotheses) != len(references):
            raise ValueError(
                "In word error rate calculation, hypotheses and reference"
                " lists must have the same number of elements. But I got:"
                "{0} and {1} correspondingly".format(len(hypotheses), len(references))
            )
        for h, r in zip(hypotheses, references):
            h_list = h.split()
            r_list = r.split()
            words += len(r_list)
            scores += self._levenshtein(h_list, r_list)
        if words != 0:
            wer = 1.0 * scores / words
        else:
            wer = float("inf")
        return wer, scores, words

        Computes Average Word Error rate between two texts represented as
        corresponding lists of string. Hypotheses and references must have same length.

        Args:
            hypotheses: list of hypotheses
            references: list of references

        Returns:
            (float) average word error rate
        
examples/cpu/llm/inference/single_instance/run_accuracy.py