Metadata-Version: 2.4
Name: fastwer
Version: 0.2.0
Summary: A PyPI package for fast word/character error rate (WER/CER) calculation
Home-page: https://github.com/kahne/fastwer
Author: Changhan Wang
Author-email: wangchanghan@gmail.com
License: MIT
Project-URL: Issues, https://github.com/kahne/fastwer/issues
Project-URL: Source, https://github.com/kahne/fastwer
Classifier: Intended Audience :: Science/Research
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: license
Dynamic: license-file
Dynamic: project-url
Dynamic: requires-python
Dynamic: summary

FastWER
====

A PyPI package for fast word/character error rate (WER/CER) calculation
* fast (cpp implementation)
* sentence-level and corpus-level WER/CER scores
* Unicode code point-based character error rates


# Installation
```bash
pip install fastwer
```

# Example
```python
import fastwer
hypo = ['This is an example .', 'This is another example .']
ref = ['This is the example :)', 'That is the example .']

# Corpus-Level WER: 40.0
fastwer.score(hypo, ref)
# Corpus-Level CER: 25.5814
fastwer.score(hypo, ref, char_level=True)

# Sentence-Level WER: 40.0
fastwer.score_sent(hypo[0], ref[0])
# Sentence-Level CER: 22.7273
fastwer.score_sent(hypo[0], ref[0], char_level=True)
```

Character-level scoring treats each Unicode code point as one character.
Normalize text before scoring if canonically equivalent representations, such
as composed and decomposed accented characters, should compare as equal.


# Contact
Changhan Wang (wangchanghan@gmail.com)
