





import itertools
import random
import unittest

import numpy as np

from transformers import BatchFeature, SpeechTaFeatureExtractor
from transformers.testing_utils import require_torch
from transformers.utils.import_utils import is_torch_available

from ...test_sequence_feature_extraction_common import SequenceFeatureExtractionTestMixin


if is_torch_available():
    import torch


lowercase      :       Tuple									=  random.Random()



def A_	(		A__		,      A__=1.0		,      A__=None		,      A__=None				)  ->		List[Any]:
       if rng is None:
              a__						:	int =				global_rng

       a__						:	Union[str, Any] =				[]
       for batch_idx in range(shape[0]				):
              values.append([]				)
              for _ in range(shape[1]				):
                     values[-1].append(rng.random() * scale				)

       return values





@require_torch
class  A__    (							unittest.TestCase	):




   """simple docstring"""



   def __init__(					self					,  lowercase					,  lowercase=7					,  lowercase=400					,  lowercase=2000					,  lowercase=1					,  lowercase=0.0					,  lowercase=1_6000					,  lowercase=True					,  lowercase=80					,  lowercase=16					,  lowercase=64					,  lowercase="hann_window"					,  lowercase=80					,  lowercase=7600					,  lowercase=1e-10					,  lowercase=True					,  )			->						List[Any]:







          '''simple docstring'''

          a__						:	List[str] =				parent
          a__						:	Any =				batch_size
          a__						:	List[Any] =				min_seq_length
          a__						:	Any =				max_seq_length
          a__						:	str =				(self.max_seq_length - self.min_seq_length) // (self.batch_size - 1)
          a__						:	Union[str, Any] =				feature_size
          a__						:	List[Any] =				padding_value
          a__						:	Tuple =				sampling_rate
          a__						:	Optional[Any] =				do_normalize
          a__						:	Optional[Any] =				num_mel_bins
          a__						:	Tuple =				hop_length
          a__						:	int =				win_length
          a__						:	List[str] =				win_function
          a__						:	int =				fmin
          a__						:	str =				fmax
          a__						:	Optional[Any] =				mel_floor
          a__						:	Optional[Any] =				return_attention_mask

   def 							__lowercase		(					self)			->						List[str]:







          '''simple docstring'''

          return {
              "feature_size": self.feature_size,
              "padding_value": self.padding_value,
              "sampling_rate": self.sampling_rate,
              "do_normalize": self.do_normalize,
              "num_mel_bins": self.num_mel_bins,
              "hop_length": self.hop_length,
              "win_length": self.win_length,
              "win_function": self.win_function,
              "fmin": self.fmin,
              "fmax": self.fmax,
              "mel_floor": self.mel_floor,
              "return_attention_mask": self.return_attention_mask,
          }

   def 							__lowercase		(					self					,  lowercase=False					,  lowercase=False)			->						Optional[Any]:







          '''simple docstring'''

          def _flatten(lowercase):
                 return list(itertools.chain(*lowercase))

          if equal_length:
                 a__						:	Optional[Any] =				floats_list((self.batch_size, self.max_seq_length))
          else:
                 # make sure that inputs increase in size
                 a__						:	List[str] =				[
                     _flatten(floats_list((x, self.feature_size)))
                     for x in range(self.min_seq_length					,  self.max_seq_length					,  self.seq_length_diff)
                 ]

          if numpify:
                 a__						:	Any =				[np.asarray(lowercase) for x in speech_inputs]

          return speech_inputs

   def 							__lowercase		(					self					,  lowercase=False					,  lowercase=False)			->						Optional[Any]:







          '''simple docstring'''

          if equal_length:
                 a__						:	Optional[int] =				[floats_list((self.max_seq_length, self.num_mel_bins)) for _ in range(self.batch_size)]
          else:
                 # make sure that inputs increase in size
                 a__						:	Any =				[
                     floats_list((x, self.num_mel_bins))
                     for x in range(self.min_seq_length					,  self.max_seq_length					,  self.seq_length_diff)
                 ]

          if numpify:
                 a__						:	List[str] =				[np.asarray(lowercase) for x in speech_inputs]

          return speech_inputs





@require_torch
class  A__    (							__UpperCAmelCase ,  unittest.TestCase	):




   """simple docstring"""



   __A   :				List[str]         =  SpeechTaFeatureExtractor

   def 							__lowercase		(					self)			->						Optional[Any]:







          '''simple docstring'''

          a__						:	Optional[int] =				SpeechTaFeatureExtractionTester(self)

   def 							__lowercase		(					self					,  lowercase)			->						str:







          '''simple docstring'''

          self.assertTrue(np.all(np.mean(lowercase					,  axis=0) < 1e-3))
          self.assertTrue(np.all(np.abs(np.var(lowercase					,  axis=0) - 1) < 1e-3))

   def 							__lowercase		(					self)			->						Tuple:







          '''simple docstring'''

          a__						:	Optional[Any] =				self.feature_extraction_class(**self.feat_extract_tester.prepare_feat_extract_dict())
          # create three inputs of length 800, 1000, and 1200
          a__						:	int =				[floats_list((1, x))[0] for x in range(800					,  1400					,  200)]
          a__						:	Any =				[np.asarray(lowercase) for speech_input in speech_inputs]

          # Test not batched input
          a__						:	Optional[Any] =				feat_extract(speech_inputs[0]					,  return_tensors='np').input_values
          a__						:	Optional[int] =				feat_extract(np_speech_inputs[0]					,  return_tensors='np').input_values
          self.assertTrue(np.allclose(lowercase					,  lowercase					,  atol=1e-3))

          # Test batched
          a__						:	int =				feat_extract(lowercase					,  return_tensors='np').input_values
          a__						:	Dict =				feat_extract(lowercase					,  return_tensors='np').input_values
          for enc_seq_a, enc_seq_a in zip(lowercase					,  lowercase):
                 self.assertTrue(np.allclose(lowercase					,  lowercase					,  atol=1e-3))

   def 							__lowercase		(					self)			->						Any:







          '''simple docstring'''

          a__						:	str =				self.feature_extraction_class(**self.feat_extract_tester.prepare_feat_extract_dict())
          a__						:	List[str] =				[floats_list((1, x))[0] for x in range(800					,  1400					,  200)]

          a__						:	int =				['longest', 'max_length', 'do_not_pad']
          a__						:	Union[str, Any] =				[None, 1600, None]
          for max_length, padding in zip(lowercase					,  lowercase):
                 a__						:	Any =				feat_extract(lowercase					,  padding=lowercase					,  max_length=lowercase					,  return_tensors='np')
                 a__						:	Union[str, Any] =				processed.input_values

                 self._check_zero_mean_unit_variance(input_values[0][:800])
                 self.assertTrue(input_values[0][800:].sum() < 1e-6)
                 self._check_zero_mean_unit_variance(input_values[1][:1000])
                 self.assertTrue(input_values[0][1000:].sum() < 1e-6)
                 self._check_zero_mean_unit_variance(input_values[2][:1200])

   def 							__lowercase		(					self)			->						List[Any]:







          '''simple docstring'''

          a__						:	Any =				self.feature_extraction_class(**self.feat_extract_tester.prepare_feat_extract_dict())
          a__						:	Dict =				range(800					,  1400					,  200)
          a__						:	int =				[floats_list((1, x))[0] for x in lengths]

          a__						:	Dict =				['longest', 'max_length', 'do_not_pad']
          a__						:	Tuple =				[None, 1600, None]

          for max_length, padding in zip(lowercase					,  lowercase):
                 a__						:	int =				feat_extract(lowercase					,  max_length=lowercase					,  padding=lowercase)
                 a__						:	Optional[Any] =				processed.input_values

                 self._check_zero_mean_unit_variance(input_values[0][:800])
                 self._check_zero_mean_unit_variance(input_values[1][:1000])
                 self._check_zero_mean_unit_variance(input_values[2][:1200])

   def 							__lowercase		(					self)			->						str:







          '''simple docstring'''

          a__						:	Tuple =				self.feature_extraction_class(**self.feat_extract_tester.prepare_feat_extract_dict())
          a__						:	List[Any] =				[floats_list((1, x))[0] for x in range(800					,  1400					,  200)]
          a__						:	Dict =				feat_extract(
              lowercase					,  truncation=lowercase					,  max_length=1000					,  padding='max_length'					,  return_tensors='np')
          a__						:	Union[str, Any] =				processed.input_values

          self._check_zero_mean_unit_variance(input_values[0, :800])
          self._check_zero_mean_unit_variance(input_values[1])
          self._check_zero_mean_unit_variance(input_values[2])

   def 							__lowercase		(					self)			->						int:







          '''simple docstring'''

          a__						:	List[str] =				self.feature_extraction_class(**self.feat_extract_tester.prepare_feat_extract_dict())
          a__						:	Optional[int] =				[floats_list((1, x))[0] for x in range(800					,  1400					,  200)]
          a__						:	Dict =				feat_extract(
              lowercase					,  truncation=lowercase					,  max_length=1000					,  padding='longest'					,  return_tensors='np')
          a__						:	List[Any] =				processed.input_values

          self._check_zero_mean_unit_variance(input_values[0, :800])
          self._check_zero_mean_unit_variance(input_values[1, :1000])
          self._check_zero_mean_unit_variance(input_values[2])

          # make sure that if max_length < longest -> then pad to max_length
          self.assertTrue(input_values.shape == (3, 1000))

          a__						:	Dict =				[floats_list((1, x))[0] for x in range(800					,  1400					,  200)]
          a__						:	int =				feat_extract(
              lowercase					,  truncation=lowercase					,  max_length=2000					,  padding='longest'					,  return_tensors='np')
          a__						:	Optional[Any] =				processed.input_values

          self._check_zero_mean_unit_variance(input_values[0, :800])
          self._check_zero_mean_unit_variance(input_values[1, :1000])
          self._check_zero_mean_unit_variance(input_values[2])

          # make sure that if max_length > longest -> then pad to longest
          self.assertTrue(input_values.shape == (3, 1200))

   def 							__lowercase		(					self)			->						str:







          '''simple docstring'''

          a__						:	Any =				self.feature_extraction_class(**self.feat_extract_tester.prepare_feat_extract_dict())
          a__						:	Any =				np.random.rand(100).astype(np.floataa)
          a__						:	Optional[Any] =				np_speech_inputs.tolist()

          for inputs in [py_speech_inputs, np_speech_inputs]:
                 a__						:	List[str] =				feature_extractor.pad([{'input_values': inputs}]					,  return_tensors='np')
                 self.assertTrue(np_processed.input_values.dtype == np.floataa)
                 a__						:	Tuple =				feature_extractor.pad([{'input_values': inputs}]					,  return_tensors='pt')
                 self.assertTrue(pt_processed.input_values.dtype == torch.floataa)

   def 							__lowercase		(					self)			->						List[str]:







          '''simple docstring'''

          a__						:	int =				self.feature_extraction_class(**self.feat_extract_tester.prepare_feat_extract_dict())
          # create three inputs of length 800, 1000, and 1200
          a__						:	List[Any] =				[floats_list((1, x))[0] for x in range(800					,  1400					,  200)]
          a__						:	Any =				[np.asarray(lowercase) for speech_input in speech_inputs]

          # Test feature size
          a__						:	List[str] =				feature_extractor(audio_target=lowercase					,  padding=lowercase					,  return_tensors='np').input_values
          self.assertTrue(input_values.ndim == 3)
          self.assertTrue(input_values.shape[-1] == feature_extractor.num_mel_bins)

          # Test not batched input
          a__						:	Union[str, Any] =				feature_extractor(speech_inputs[0]					,  return_tensors='np').input_values
          a__						:	Optional[int] =				feature_extractor(np_speech_inputs[0]					,  return_tensors='np').input_values
          self.assertTrue(np.allclose(lowercase					,  lowercase					,  atol=1e-3))

          # Test batched
          a__						:	Optional[int] =				feature_extractor(lowercase					,  return_tensors='np').input_values
          a__						:	Union[str, Any] =				feature_extractor(lowercase					,  return_tensors='np').input_values
          for enc_seq_a, enc_seq_a in zip(lowercase					,  lowercase):
                 self.assertTrue(np.allclose(lowercase					,  lowercase					,  atol=1e-3))

          # Test 2-D numpy arrays are batched.
          a__						:	int =				[floats_list((1, x))[0] for x in (800, 800, 800)]
          a__						:	List[str] =				np.asarray(lowercase)
          a__						:	Dict =				feature_extractor(lowercase					,  return_tensors='np').input_values
          a__						:	int =				feature_extractor(lowercase					,  return_tensors='np').input_values
          for enc_seq_a, enc_seq_a in zip(lowercase					,  lowercase):
                 self.assertTrue(np.allclose(lowercase					,  lowercase					,  atol=1e-3))

   def 							__lowercase		(					self)			->						str:







          '''simple docstring'''

          a__						:	Dict =				self.feat_extract_tester.prepare_inputs_for_target()
          a__						:	Any =				self.feature_extraction_class(**self.feat_extract_dict)
          a__						:	List[str] =				feat_extract.model_input_names[0]

          a__						:	int =				BatchFeature({input_name: speech_inputs})

          self.assertTrue(all(len(lowercase) == len(lowercase) for x, y in zip(lowercase					,  processed_features[input_name])))

          a__						:	str =				self.feat_extract_tester.prepare_inputs_for_target(equal_length=lowercase)
          a__						:	str =				BatchFeature({input_name: speech_inputs}					,  tensor_type='np')

          a__						:	Dict =				processed_features[input_name]

          if len(batch_features_input.shape) < 3:
                 a__						:	List[Any] =				batch_features_input[:, :, None]

          self.assertTrue(
              batch_features_input.shape
              == (self.feat_extract_tester.batch_size, len(speech_inputs[0]), self.feat_extract_tester.num_mel_bins))

   @require_torch
   def 							__lowercase		(					self)			->						str:







          '''simple docstring'''

          a__						:	Union[str, Any] =				self.feat_extract_tester.prepare_inputs_for_target(equal_length=lowercase)
          a__						:	Tuple =				self.feature_extraction_class(**self.feat_extract_dict)
          a__						:	Union[str, Any] =				feat_extract.model_input_names[0]

          a__						:	List[Any] =				BatchFeature({input_name: speech_inputs}					,  tensor_type='pt')

          a__						:	str =				processed_features[input_name]

          if len(batch_features_input.shape) < 3:
                 a__						:	Optional[int] =				batch_features_input[:, :, None]

          self.assertTrue(
              batch_features_input.shape
              == (self.feat_extract_tester.batch_size, len(speech_inputs[0]), self.feat_extract_tester.num_mel_bins))

   @require_torch
   def 							__lowercase		(					self)			->						Optional[int]:







          '''simple docstring'''

          a__						:	Optional[Any] =				self.feature_extraction_class(**self.feat_extract_dict)
          a__						:	Optional[Any] =				self.feat_extract_tester.prepare_inputs_for_target()
          a__						:	Union[str, Any] =				feat_extract.model_input_names[0]

          a__						:	Optional[int] =				BatchFeature({input_name: speech_inputs})

          a__						:	Tuple =				feat_extract.num_mel_bins  # hack!

          a__						:	Optional[int] =				feat_extract.pad(lowercase					,  padding='longest'					,  return_tensors='np')[input_name]
          a__						:	List[str] =				feat_extract.pad(lowercase					,  padding='longest'					,  return_tensors='pt')[input_name]

          self.assertTrue(abs(input_np.astype(np.floataa).sum() - input_pt.numpy().astype(np.floataa).sum()) < 1e-2)

   def 							__lowercase		(					self)			->						int:







          '''simple docstring'''

          a__						:	Tuple =				self.feat_extract_dict
          a__						:	List[str] =				True
          a__						:	Any =				self.feature_extraction_class(**lowercase)
          a__						:	int =				self.feat_extract_tester.prepare_inputs_for_target()
          a__						:	Tuple =				[len(lowercase) for x in speech_inputs]
          a__						:	str =				feat_extract.model_input_names[0]

          a__						:	Union[str, Any] =				BatchFeature({input_name: speech_inputs})

          a__						:	int =				feat_extract.num_mel_bins  # hack!

          a__						:	Union[str, Any] =				feat_extract.pad(lowercase					,  padding='longest'					,  return_tensors='np')
          self.assertIn('attention_mask'					,  lowercase)
          self.assertListEqual(list(processed.attention_mask.shape)					,  list(processed[input_name].shape[:2]))
          self.assertListEqual(processed.attention_mask.sum(-1).tolist()					,  lowercase)

   def 							__lowercase		(					self)			->						Optional[int]:







          '''simple docstring'''

          a__						:	Dict =				self.feat_extract_dict
          a__						:	List[Any] =				True
          a__						:	Tuple =				self.feature_extraction_class(**lowercase)
          a__						:	Dict =				self.feat_extract_tester.prepare_inputs_for_target()
          a__						:	Union[str, Any] =				[len(lowercase) for x in speech_inputs]
          a__						:	Dict =				feat_extract.model_input_names[0]

          a__						:	str =				BatchFeature({input_name: speech_inputs})
          a__						:	Tuple =				min(lowercase)

          a__						:	List[Any] =				feat_extract.num_mel_bins  # hack!

          a__						:	Optional[Any] =				feat_extract.pad(
              lowercase					,  padding='max_length'					,  max_length=lowercase					,  truncation=lowercase					,  return_tensors='np')
          self.assertIn('attention_mask'					,  lowercase)
          self.assertListEqual(
              list(processed_pad.attention_mask.shape)					,  [processed_pad[input_name].shape[0], max_length])
          self.assertListEqual(
              processed_pad.attention_mask[:, :max_length].sum(-1).tolist()					,  [max_length for x in speech_inputs])

   def 							__lowercase		(					self					,  lowercase)			->						List[Any]:







          '''simple docstring'''

          from datasets import load_dataset

          a__						:	str =				load_dataset('hf-internal-testing/librispeech_asr_dummy'					,  'clean'					,  split='validation')
          # automatic decoding with librispeech
          a__						:	int =				ds.sort('id').select(range(lowercase))[:num_samples]['audio']

          return [x["array"] for x in speech_samples]

   def 							__lowercase		(					self)			->						int:







          '''simple docstring'''

          a__						:	str =				torch.tensor(
              [2.3804e-03, 2.0752e-03, 1.9836e-03, 2.1057e-03, 1.6174e-03,
               3.0518e-04, 9.1553e-05, 3.3569e-04, 9.7656e-04, 1.8311e-03,
               2.0142e-03, 2.1057e-03, 1.7395e-03, 4.5776e-04, -3.9673e-04,
               4.5776e-04, 1.0071e-03, 9.1553e-05, 4.8828e-04, 1.1597e-03,
               7.3242e-04, 9.4604e-04, 1.8005e-03, 1.8311e-03, 8.8501e-04,
               4.2725e-04, 4.8828e-04, 7.3242e-04, 1.0986e-03, 2.1057e-03])
          # fmt: on

          a__						:	str =				self._load_datasamples(1)
          a__						:	Union[str, Any] =				SpeechTaFeatureExtractor()
          a__						:	str =				feature_extractor(lowercase					,  return_tensors='pt').input_values
          self.assertEquals(input_values.shape					,  (1, 9_3680))
          self.assertTrue(torch.allclose(input_values[0, :30]					,  lowercase					,  atol=1e-6))

   def 							__lowercase		(					self)			->						List[str]:







          '''simple docstring'''

          a__						:	Tuple =				torch.tensor(
              [-2.68_70, -3.01_04, -3.13_56, -3.53_52, -3.00_44, -3.03_53, -3.47_19, -3.67_77,
               -3.15_20, -2.94_35, -2.65_53, -2.87_95, -2.99_44, -2.59_21, -3.02_79, -3.03_86,
               -3.08_64, -3.12_91, -3.23_53, -2.74_44, -2.68_31, -2.72_87, -3.17_61, -3.15_71,
               -3.27_26, -3.05_82, -3.10_07, -3.45_33, -3.46_95, -3.09_98])
          # fmt: on

          a__						:	int =				self._load_datasamples(1)
          a__						:	Optional[int] =				SpeechTaFeatureExtractor()
          a__						:	Union[str, Any] =				feature_extractor(audio_target=lowercase					,  return_tensors='pt').input_values
          self.assertEquals(input_values.shape					,  (1, 366, 80))
          self.assertTrue(torch.allclose(input_values[0, 0, :30]					,  lowercase					,  atol=1e-4))









from typing import List

import jiwer
import jiwer.transforms as tr
from packaging import version

import datasets
from datasets.config import PY_VERSION


if PY_VERSION < version.parse("""3.8"""):
    import importlib_metadata
else:
    import importlib.metadata as importlib_metadata


lowercase      :       Tuple									=  """"""


if version.parse(importlib_metadata.version("""jiwer""")) < version.parse("""2.3.0"""):





    class  A__    (							tr.AbstractTransform	):




       """simple docstring"""



       def __init__(					self					,  lowercase = " ")			->						Tuple:







              '''simple docstring'''

              a__						:	Tuple =				sentence_delimiter

       def 							__lowercase		(					self					,  lowercase)			->						Optional[int]:







              '''simple docstring'''

              return list(lowercase)

       def 							__lowercase		(					self					,  lowercase)			->						Dict:







              '''simple docstring'''

              a__						:	Tuple =				[]
              for sent_idx, sentence in enumerate(lowercase):
                     chars.extend(self.process_string(lowercase))
                     if self.sentence_delimiter is not None and self.sentence_delimiter != "" and sent_idx < len(lowercase) - 1:
                            chars.append(self.sentence_delimiter)
              return chars

    lowercase      :       Union[str, Any]									=  tr.Compose(
        [tr.RemoveMultipleSpaces(), tr.Strip(), SentencesToListOfCharacters(SENTENCE_DELIMITER)]
    )
else:
    lowercase      :       List[str]									=  tr.Compose(
        [
            tr.RemoveMultipleSpaces(),
            tr.Strip(),
            tr.ReduceToSingleSentence(SENTENCE_DELIMITER),
            tr.ReduceToListOfListOfChars(),
        ]
    )


lowercase      :       List[Any]									=  """\
@inproceedings{inproceedings,
    author = {Morris, Andrew and Maier, Viktoria and Green, Phil},
    year = {2004},
    month = {01},
    pages = {},
    title = {From WER and RIL to MER and WIL: improved evaluation measures for connected speech recognition.}
}
"""

lowercase      :       Optional[int]									=  """\
Character error rate (CER) is a common metric of the performance of an automatic speech recognition system.

CER is similar to Word Error Rate (WER), but operates on character instead of word. Please refer to docs of WER for further information.

Character error rate can be computed as:

CER = (S + D + I) / N = (S + D + I) / (S + D + C)

where

S is the number of substitutions,
D is the number of deletions,
I is the number of insertions,
C is the number of correct characters,
N is the number of characters in the reference (N=S+D+C).

CER's output is not always a number between 0 and 1, in particular when there is a high number of insertions. This value is often associated to the percentage of characters that were incorrectly predicted. The lower the value, the better the
performance of the ASR system with a CER of 0 being a perfect score.
"""

lowercase      :       Optional[Any]									=  """
Computes CER score of transcribed segments against references.
Args:
    references: list of references for each speech input.
    predictions: list of transcribtions to score.
    concatenate_texts: Whether or not to concatenate sentences before evaluation, set to True for more accurate result.
Returns:
    (float): the character error rate

Examples:

    >>> predictions = [\"this is the prediction\", \"there is an other sample\"]
    >>> references = [\"this is the reference\", \"there is another one\"]
    >>> cer = datasets.load_metric(\"cer\")
    >>> cer_score = cer.compute(predictions=predictions, references=references)
    >>> print(cer_score)
    0.34146341463414637
"""





@datasets.utils.file_utils.add_start_docstrings(_DESCRIPTION ,  _KWARGS_DESCRIPTION	)
class  A__    (							datasets.Metric	):




   """simple docstring"""



   def 							__lowercase		(					self)			->						Union[str, Any]:







          '''simple docstring'''

          return datasets.MetricInfo(
              description=_DESCRIPTION					,  citation=_CITATION					,  inputs_description=_KWARGS_DESCRIPTION					,  features=datasets.Features(
                  {
                      'predictions': datasets.Value('string'					,  id='sequence'),
                      'references': datasets.Value('string'					,  id='sequence'),
                  })					,  codebase_urls=['https://github.com/jitsi/jiwer/']					,  reference_urls=[
                  'https://en.wikipedia.org/wiki/Word_error_rate',
                  'https://sites.google.com/site/textdigitisation/qualitymeasures/computingerrorrates',
              ]					,  )

   def 							__lowercase		(					self					,  lowercase					,  lowercase					,  lowercase=False)			->						Any:







          '''simple docstring'''

          if concatenate_texts:
                 return jiwer.compute_measures(
                     lowercase					,  lowercase					,  truth_transform=lowercase					,  hypothesis_transform=lowercase					,  )["wer"]

          a__						:	Optional[int] =				0
          a__						:	str =				0
          for prediction, reference in zip(lowercase					,  lowercase):
                 a__						:	Optional[int] =				jiwer.compute_measures(
                     lowercase					,  lowercase					,  truth_transform=lowercase					,  hypothesis_transform=lowercase					,  )
                 incorrect += measures["substitutions"] + measures["deletions"] + measures["insertions"]
                 total += measures["substitutions"] + measures["deletions"] + measures["hits"]

          return incorrect / total


