https://github.com/jumon/pywer
A simple Python package to calculate word error rate (WER).
https://github.com/jumon/pywer
speech-recognition speech-to-text wer word-error-rate
Last synced: 3 months ago
JSON representation
A simple Python package to calculate word error rate (WER).
- Host: GitHub
- URL: https://github.com/jumon/pywer
- Owner: jumon
- License: mit
- Created: 2021-02-06T08:02:02.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2021-02-07T08:58:53.000Z (over 4 years ago)
- Last Synced: 2024-08-08T23:21:18.204Z (about 1 year ago)
- Topics: speech-recognition, speech-to-text, wer, word-error-rate
- Language: Python
- Homepage:
- Size: 12.7 KB
- Stars: 5
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# pywer


[](https://codecov.io/gh/jumon/pywer)Pywer is a simple Python package to calculate word error rate (WER). Pywer can also
calculate character error rate (CER).## Install
You can install pywer via pip.
```
pip install pywer
```## Usage
```python
import pywerreferences = [
"this is a simple python package",
"it calculates word error rate",
"it can also calculate cer",
]
hypotheses = [
"this is the simple python package",
"it calculates word error",
"it can also calculate see er",
]wer = pywer.wer(references, hypotheses)
cer = pywer.cer(references, hypotheses)
print(f"WER: {wer:.2f}, CER: {cer:.2f}")
```## Development
Install pre-commit hooks.
```
pip install pre-commit
pre-commit install --install-hooks
```