How to use the jiwer.compute_measures function in jiwer

To help you get started, we’ve selected a few jiwer examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github jitsi / asr-wer / tests / test_measures.py View on Github external
def _apply_test_on(self, cases):
        for gt, h, correct_measures in cases:
            measures = jiwer.compute_measures(truth=gt, hypothesis=h)
            self.assertDictAlmostEqual(measures, correct_measures, delta=1e-16)
github jitsi / asr-wer / tests / test_measures.py View on Github external
self._apply_test_on(cases)

        ground_truth = [
            "i like monthy python",
            "what do you mean african or european swallow",
        ]
        hypothesis = ["i like", "python", "what you mean", "or swallow"]
        x = jiwer.compute_measures(ground_truth, hypothesis)

        # is equivalent to

        ground_truth = (
            "i like monthy python what do you mean african or european swallow"
        )
        hypothesis = "i like python what you mean or swallow"
        y = jiwer.compute_measures(ground_truth, hypothesis)

        self.assertDictAlmostEqual(x, y, delta=1e-9)
github jitsi / asr-wer / tests / test_measures.py View on Github external
),
            (
                "i am a short ground truth",
                "i am a considerably longer and very much incorrect hypothesis",
                _m(7 / 6, 0.7, 0.85),
            ),
        ]

        self._apply_test_on(cases)

        ground_truth = [
            "i like monthy python",
            "what do you mean african or european swallow",
        ]
        hypothesis = ["i like", "python", "what you mean", "or swallow"]
        x = jiwer.compute_measures(ground_truth, hypothesis)

        # is equivalent to

        ground_truth = (
            "i like monthy python what do you mean african or european swallow"
        )
        hypothesis = "i like python what you mean or swallow"
        y = jiwer.compute_measures(ground_truth, hypothesis)

        self.assertDictAlmostEqual(x, y, delta=1e-9)