dangkhoadl / WER-in-cpp

Calculates the word error rate between the reference and hypothesis in ASR, then print the aligned result.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

WER-in-cpp

  • Based on WER-in-python and kaldi's compute-wer.cc implementation of computing word-error-rate (WER) using edit distance dynamic programming. I port the algorithm into C++ with new features:
    • Support multi-line reference and hypothesis
    • Improve the runtime and feasibility when aligning long sentences

build

git clone https://github.com/dangkhoadl/WER-in-cpp.git
cd WER-in-cpp
make build

Usage

chmod +x compute-wer
./compute-wer [Reference] [Hypothesis]

Examples

  • Reference samples/ref
  • Hypothesis samples/hyp
  • Result: ./compute-wer samples/ref samples/hyp

About

Calculates the word error rate between the reference and hypothesis in ASR, then print the aligned result.

License:MIT License


Languages

Language:C++ 98.0%Language:Makefile 2.0%