Skip to main content

Compute Word Error Rate for Tibetan language text.

Project description

Tibetan-WER

This module provides a means to calculate Word Error Rate, and the Syllable Error Rate for Tibetan language text.

Install

Install the library to get started:

pip install --upgrade tibetan_wer

Usage

The wer function expects a list of predictions and a list of references and returns a dictionary of the micro and macro average WER as well as the total number of substitutions, insertions, and deletions.

from tibetan_wer.metrics import wer

rediction = ['གཞོན་ནུར་གྱུར་པ་ལ་ཕྱག་འཚལ་ལོ༔']
reference = ['འཇམ་དཔལ་གཞོན་ནུར་གྱུར་པ་ལ་ཕྱག་འཚལ་ལོ༔']

result = wer(prediction, reference)

print(f'Micro-Average WER Score: {result['micro_wer']}')
print(f'Macro-Average WER Score: {result['macro_wer']}')
print(f'Substitutions: {result['substitutions']}')
print(f'Insertions: {result['insertions']}')
print(f'Deletions: {result['deletions']}')

The ser function works very similarly.

from tibetan_wer.metrics import ser

prediction = ['གཞོན་ནུར་གྱུར་པ་ལ་ཕྱག་འཚལ་ལོ༔']
reference = ['འཇམ་དཔལ་གཞོན་ནུར་གྱུར་པ་ལ་ཕྱག་འཚལ་ལོ༔']

result = ser(prediction, reference)

print(f'Micro-Average SER Score: {result['micro_ser']:.3f}')
print(f'Macro-Average SER Score: {result['macro_ser']:.3f}')
print(f'Substitutions: {result['substitutions']:.3f}')
print(f'Insertions: {result['insertions']:.3f}')
print(f'Deletions: {result['deletions']:.3f}')

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tibetan_wer-1.0.0.tar.gz (7.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tibetan_wer-1.0.0-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

File details

Details for the file tibetan_wer-1.0.0.tar.gz.

File metadata

  • Download URL: tibetan_wer-1.0.0.tar.gz
  • Upload date:
  • Size: 7.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for tibetan_wer-1.0.0.tar.gz
Algorithm Hash digest
SHA256 646ec82ac66f2f97603414f8df16d91f35e543a31cd8fcbbad298dd83dd87bc4
MD5 e7035983730b335fd9b41ec355e86c0d
BLAKE2b-256 20d216634dbcbc1cf6d3a8a98f21982bdc087052fb657131de1ab1990c65013f

See more details on using hashes here.

File details

Details for the file tibetan_wer-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: tibetan_wer-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 7.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for tibetan_wer-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c19ff6d6d9b17ad01f7c92f01bc9863f5bf00062344c83ae525113272a62e57a
MD5 fc0e427f1731c96ad1fbb51f0a83202e
BLAKE2b-256 319d34f6902d4036fb4a24c16042ae79d7431858b586f847727b8ae60c8a5809

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page