Skip to content
/ fastwer Public
forked from kahne/fastwer

A PyPI package for fast word/character error rate (WER/CER) calculation

License

Notifications You must be signed in to change notification settings

PRHLT/fastwer

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FastWER

A PyPI package for fast word/character error rate (WER/CER) calculation

  • fast (cpp implementation)
  • sentence-level and corpus-level WER/CER scores

It was also extended with new functionalities:

  • Computation of Bag of words
  • Support for UTF.8 encoding
  • Traceback algorithm implementation for obtaining the aligning-path through a minimum edit-distance between reference and hypothesis strings

Installation

pip install pybind11 fastwer

Example

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)

Contact

About

A PyPI package for fast word/character error rate (WER/CER) calculation

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 58.1%
  • C++ 41.9%