Skip to main content

No project description provided

Project description

asrp

ASR text preprocessing utility

install

pip install asrp

usage - preprocess

input: dictionary, with key sentence
output: preprocessed result, inplace handling.

import asrp

batch_data = {
    'sentence': "I'm fine, thanks."
}
asrp.fun_en(batch_data)

dynamic loading

import asrp

batch_data = {
    'sentence': "I'm fine, thanks."
}
preprocessor = getattr(asrp, 'fun_en')
preprocessor(batch_data)

usage - evaluation

import asrp

targets = ['HuggingFace is great!', 'Love Transformers!', 'Let\'s wav2vec!']
preds = ['HuggingFace is awesome!', 'Transformers is powerful.', 'Let\'s finetune wav2vec!']
print("chunk size WER: {:2f}".format(100 * asrp.chunked_wer(targets, preds, chunk_size=None)))
print("chunk size CER: {:2f}".format(100 * asrp.chunked_cer(targets, preds, chunk_size=None)))

usage - hubertcode

import asrp

hc = asrp.HubertCode("facebook/hubert-large-ll60k", './km_feat_100_layer_20', 20)
hc('voice file path')

usage - code2speech

import asrp

code = []  # discrete unit
# download tts checkpoint and waveglow_checkpint from https://github.com/pytorch/fairseq/tree/main/examples/textless_nlp/gslm/unit2speech
cs = asrp.Code2Speech(tts_checkpoint='./tts_checkpoint_best.pt', waveglow_checkpint='waveglow_256channels_new.pt')
cs(code)

# play on notebook
import IPython.display as ipd

ipd.Audio(data=cs(code), autoplay=False, rate=cs.sample_rate)

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

asrp-0.0.13.tar.gz (25.4 kB view details)

Uploaded Source

Built Distributions

asrp-0.0.13-py3.7.egg (47.7 kB view details)

Uploaded Source

asrp-0.0.13-py3-none-any.whl (24.5 kB view details)

Uploaded Python 3

File details

Details for the file asrp-0.0.13.tar.gz.

File metadata

  • Download URL: asrp-0.0.13.tar.gz
  • Upload date:
  • Size: 25.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/57.0.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.8

File hashes

Hashes for asrp-0.0.13.tar.gz
Algorithm Hash digest
SHA256 6b92db7b2adbcf7b66cb01b11373a995a13235efe0f0edeabf8543a9d2dde4a6
MD5 cd26b19bf70ec2048c0d15cd87043c0b
BLAKE2b-256 c69a704ef75c16f4d366aa4215fdc6a2c65663f22d354e8dbf3d34c6c7de5b93

See more details on using hashes here.

File details

Details for the file asrp-0.0.13-py3.7.egg.

File metadata

  • Download URL: asrp-0.0.13-py3.7.egg
  • Upload date:
  • Size: 47.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/57.0.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.8

File hashes

Hashes for asrp-0.0.13-py3.7.egg
Algorithm Hash digest
SHA256 1edd4a2a849156530bd4b369017df1b94f27d1ee1851257f0216b6153dcc108f
MD5 b6b2b1b37f3db5562b872f44b1b2c4da
BLAKE2b-256 db03f84ed5d05757e80f53a37edc376d5a6a38faf7a1190b30dba1ce02f9a5f0

See more details on using hashes here.

File details

Details for the file asrp-0.0.13-py3-none-any.whl.

File metadata

  • Download URL: asrp-0.0.13-py3-none-any.whl
  • Upload date:
  • Size: 24.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/57.0.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.8

File hashes

Hashes for asrp-0.0.13-py3-none-any.whl
Algorithm Hash digest
SHA256 22699390679be19f57f82a1a2b992a0d860a301f5bbee1a91adffa08d34068ea
MD5 5f8a7bba2f03810ea0892d552fe740c9
BLAKE2b-256 a9047b3feb318ece4db6a7f6676b5a8b014572739360beb1fda46af2f59cb36e

See more details on using hashes here.

Supported by

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