Word Error Rate for Python

werpy is a powerful yet lightweight Python package that rapidly calculates and analyzes the Word Error Rate (WER) between two sets of text.

Word Error Rate (WER) is a common metric used to evaluate the accuracy of automatic speech recognition (ASR) or automatic transcription systems. It quantifies the disparity between the output generated by the system and a reference or ground truth transcript.

WER is computed by comparing the number of insertions, deletions, and substitutions needed to transform the system’s output into the reference transcript, normalized by the total number of words in the reference. The lower the WER, the better the system’s performance, as it indicates a smaller divergence from the true transcription.

WER provides a comprehensive assessment of the overall accuracy of speech recognition systems and is widely employed in the field of natural language processing and audio analysis to gauge the effectiveness of automatic transcription technologies.


Our aim was to incorporate a practical set of features that meet the users’ needs, including:

  • Individual & Aggregate Results: Can compute the word error rate for each text sequence and can also calculate a cumulative word error rate across all sequences.

  • Normalization: Standardizing text enhances adaptability to data variability. Techniques like lowercasing and punctuation removal during normalization enable more effective comparisons.

  • Weight Assignment: Enables the allocation of weights/costs to particular error classifications.

  • Analysis: Options to present a comprehensive breakdown of calculated results, enabling swift and detailed examination of specific errors.

Design Objectives

The creation of this package was guided by the following user objectives:

  • Simplicity: Crafted to be user-friendly and straightforward to use for datasets of all sizes.

  • Flexibility: Capable of handling multiple input data types (e.g., strings, lists, and NumPy arrays).

  • Ultra-Fast: Leveraging C for the dynamic programming ensures it achieves maximum speed.

  • Quality: Delivers production-grade standards, ensuring robust performance and reliability.


Start with these documents to get you up and running with werpy: