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.18.tar.gz (25.5 kB view details)

Uploaded Source

Built Distributions

asrp-0.0.18-py3.7.egg (47.9 kB view details)

Uploaded Source

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: asrp-0.0.18.tar.gz
  • Upload date:
  • Size: 25.5 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.18.tar.gz
Algorithm Hash digest
SHA256 08508d42a162d0c2aab29746a2314eae1a8b96d9ccf0e8f0fc64ae6162af0338
MD5 119609f78fdc0d5bc776d113a8980e42
BLAKE2b-256 2d817f36c1b593cb0d8e7596b3fc8eaace1508185e86a364e8dc7ab4cae68a20

See more details on using hashes here.

File details

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

File metadata

  • Download URL: asrp-0.0.18-py3.7.egg
  • Upload date:
  • Size: 47.9 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.18-py3.7.egg
Algorithm Hash digest
SHA256 ae4694a7ae8512ac80aeeee712afb0d5e6d2ca0e8cc80c2b0b705c8d6b54a2cf
MD5 1f0cd41ed141d77a71982fc97afadb64
BLAKE2b-256 980b759babd4a9bef9f582b263be0940536c8aa350fd3b17938d0d766965d74a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: asrp-0.0.18-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.18-py3-none-any.whl
Algorithm Hash digest
SHA256 0e70c28a17cf608ea31e8c74cb1b0c485a85c8138c973ae488aea85fa2725f01
MD5 2909d60bdca1fc54a3c34272cdca1def
BLAKE2b-256 26477072da02c06b24cd4ec2000801a97752fb450f32dd77b722240dfb9d37f2

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