{"id":18664628,"url":"https://github.com/scionoftech/deepasr","last_synced_at":"2025-06-25T03:39:20.059Z","repository":{"id":45033558,"uuid":"255846055","full_name":"scionoftech/DeepAsr","owner":"scionoftech","description":"Keras(Tensorflow) implementations of Automatic Speech Recognition","archived":false,"fork":false,"pushed_at":"2022-01-13T08:11:22.000Z","size":2272,"stargazers_count":23,"open_issues_count":4,"forks_count":11,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-17T01:05:55.633Z","etag":null,"topics":["asr","deepspeech2","speech-recognition","speech-to-text"],"latest_commit_sha":null,"homepage":null,"language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/scionoftech.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-04-15T07:59:39.000Z","updated_at":"2024-12-13T14:20:28.000Z","dependencies_parsed_at":"2022-09-10T19:41:26.522Z","dependency_job_id":null,"html_url":"https://github.com/scionoftech/DeepAsr","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/scionoftech/DeepAsr","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scionoftech%2FDeepAsr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scionoftech%2FDeepAsr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scionoftech%2FDeepAsr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scionoftech%2FDeepAsr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/scionoftech","download_url":"https://codeload.github.com/scionoftech/DeepAsr/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scionoftech%2FDeepAsr/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261800808,"owners_count":23211622,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["asr","deepspeech2","speech-recognition","speech-to-text"],"created_at":"2024-11-07T08:24:19.571Z","updated_at":"2025-06-25T03:39:20.027Z","avatar_url":"https://github.com/scionoftech.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DeepAsr\nDeepAsr is an open-source \u0026 Keras (Tensorflow) implementation of end-to-end Automatic Speech Recognition (ASR) engine and it supports multiple Speech Recognition architectures.\n\nSupported Asr Architectures:\n- Baidu's Deep Speech 2\n- DeepAsrNetwork1\n\n**Using DeepAsr you can**:\n- perform speech-to-text using pre-trained models\n- tune pre-trained models to your needs\n- create new models on your own \n\n**DeepAsr key features**:\n- **Multi GPU support**: You can do much more like distribute the training using the [Strategy](https://www.tensorflow.org/guide/distributed_training), or experiment with [mixed precision](https://www.tensorflow.org/api_docs/python/tf/keras/mixed_precision/experimental/Policy) policy.\n- **CuDNN support**: Model using [CuDNNLSTM](https://keras.io/layers/recurrent/) implementation by NVIDIA Developers. CPU devices is also supported.\n- **DataGenerator**: The feature extraction during model training for large the data.\n\n## Installation\nYou can use pip:\n```bash\npip install deepasr\n```\n\n## Getting started\nThe speech recognition is a tough task. You don't need to know all details to use one of the pretrained models.\nHowever it's worth to understand conceptional crucial components:\n- **Input**: Audio files (WAV or FLAC) with mono 16-bit 16 kHz (up to 5 seconds)\n- **FeaturesExtractor**: Convert audio files using MFCC Features or Spectrogram\n- **Model**: CTC model defined in [**Keras**](https://keras.io/) (references: [[1]](https://arxiv.org/abs/1412.5567), [[2]](https://arxiv.org/abs/1512.02595))\n- **Decoder**: Greedy or BeamSearch algorithms with the language model support decode a sequence of probabilities using Alphabet\n- **DataGenerator**: Stream data to the model via generator\n- **Callbacks**: Set of functions monitoring the training\n\n```python\nimport numpy as np\nimport pandas as pd\nimport tensorflow as tf\nimport deepasr as asr\n\n# get CTCPipeline\ndef get_config(feature_type: str = 'spectrogram', multi_gpu: bool = False):\n    # audio feature extractor\n    features_extractor = asr.features.preprocess(feature_type=feature_type, features_num=161,\n                                                 samplerate=16000,\n                                                 winlen=0.02,\n                                                 winstep=0.025,\n                                                 winfunc=np.hanning)\n\n    # input label encoder\n    alphabet_en = asr.vocab.Alphabet(lang='en')\n    # training model\n    model = asr.model.get_deepspeech2(\n        input_dim=161,\n        output_dim=29,\n        is_mixed_precision=True\n    )\n    # model optimizer\n    optimizer = tf.keras.optimizers.Adam(\n        lr=1e-4,\n        beta_1=0.9,\n        beta_2=0.999,\n        epsilon=1e-8\n    )\n    # output label deocder\n    decoder = asr.decoder.GreedyDecoder()\n    # decoder = asr.decoder.BeamSearchDecoder(beam_width=100, top_paths=1)\n    # CTCPipeline\n    pipeline = asr.pipeline.ctc_pipeline.CTCPipeline(\n        alphabet=alphabet_en, features_extractor=features_extractor, model=model, optimizer=optimizer, decoder=decoder,\n        sample_rate=16000, mono=True, multi_gpu=multi_gpu\n    )\n    return pipeline\n\n\ntrain_data = pd.read_csv('train_data.csv')\n\npipeline = get_config(feature_type = 'fbank', multi_gpu=False)\n\n# train asr model\nhistory = pipeline.fit(train_dataset=train_data, batch_size=128, epochs=500)\n# history = pipeline.fit_generator(train_dataset = train_data, batch_size=32, epochs=500)\n\npipeline.save('./checkpoint')\n```\n\nLoaded pre-trained model has all components. The prediction can be invoked just by calling pipline.predict().\n\n```python\nimport pandas as pd\nimport deepasr as asr\nimport numpy as np\ntest_data = pd.read_csv('test_data.csv')\n\n# get testing audio and transcript from dataset\nindex = np.random.randint(test_data.shape[0])\ndata = test_data.iloc[index]\ntest_file = data[0]\ntest_transcript = data[1]\n# Test Audio file\nprint(\"Audio File:\",test_file)\n# Test Transcript\nprint(\"Audio Transcript:\", test_transcript)\nprint(\"Transcript length:\",len(test_transcript))\n\npipeline = asr.pipeline.load('./checkpoint')\nprint(\"Prediction\", pipeline.predict(test_file))\n```\n\n#### References\n\nThe fundamental repositories:\n- Baidu - [DeepSpeech2 - A PaddlePaddle implementation of DeepSpeech2 architecture for ASR](https://github.com/PaddlePaddle/DeepSpeech)\n- NVIDIA - [Toolkit for efficient experimentation with Speech Recognition, Text2Speech and NLP](https://nvidia.github.io/OpenSeq2Seq)\n- TensorFlow - [The implementation of DeepSpeech2 model](https://github.com/tensorflow/models/tree/master/research/deep_speech)\n- Mozilla - [DeepSpeech - A TensorFlow implementation of Baidu's DeepSpeech architecture](https://github.com/mozilla/DeepSpeech) \n- Espnet - [End-to-End Speech Processing Toolkit](https://github.com/espnet/espnet)\n- Automatic Speech Recognition - [Distill the Automatic Speech Recognition research](https://github.com/rolczynski/Automatic-Speech-Recognition)\n- Python Speech Features - [Speech features for ASR including MFCCs and filterbank energies](https://github.com/jameslyons/python_speech_features)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscionoftech%2Fdeepasr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fscionoftech%2Fdeepasr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscionoftech%2Fdeepasr/lists"}