Coder Social home page Coder Social logo

hadilotfy / deepspeech-old Goto Github PK

View Code? Open in Web Editor NEW

This project forked from 943274923/deepspeech-old

0.0 0.0 0.0 10.34 MB

Tarteel's fork of DeepSpeech with utilities

Python 12.69% Dockerfile 0.41% Shell 0.98% Makefile 0.91% C++ 63.76% C 15.71% C# 2.01% Java 1.43% CMake 1.26% JavaScript 0.83%

deepspeech-old's Introduction

Tarteel DeepSpeech

Tarteel's fork of DeepSpeech with scripts and utilities to use the Tarteel dataset.

Tarteel is on a mission to enable Muslims to enhance their recitation and memorization of the holy Quran.

Checkout tarteel.io to see our transcription and search features in action!

Please keep the contributors in your duaa if you found this helpful.

Training Setup

Regular setup

Create a virtual environment. We use one named ds-env.

workon ds-env
# Use just tensorflow if you don't have a GPU
pip3 install tensorflow-gpu==1.14.0
pip3 install -r requirements.txt
pip3 install $(python3 util/taskcluster.py --decoder)
./DeepSpeech.py --helpfull

Building from source

If you have a GPU, make sure to say yes to Cuda in the Tensorflow config step. The table of compute capabilities can be found here.

# Use a venv and a workspace
workon ds-env
mkdir ds_ws && cd ds_ws
# Setup bazel
git clone https://github.com/bazelbuild/bazelisk.git
ln -s /usr/local/bin/bazel ~/ds_ws/bazelisk/bazelisk.py
export USE_BAZEL_VERSION=0.24.1
cd ..
# Get DS and TF
git clone https://github.com/mozilla/DeepSpeech/
git clone https://github.com/mozilla/tensorflow
cd tensorflow && git checkout r1.14
# Use defaults, yes to Cuda if you have it
./configure
# Assuming you cloned everything in the same directory
ln -s ../DeepSpeech/native_client ./
bazel build --workspace_status_command="bash native_client/bazel_workspace_status_cmd.sh" \
            --config=monolithic --config=cuda -c opt --copt=-O3 --copt="-D_GLIBCXX_USE_CXX11_ABI=0" \
            --copt=-fvisibility=hidden //native_client:libdeepspeech.so //native_client:generate_trie
cd ~/ds_ws/DeepSpeech/native_client
export TFDIR=~/ds_ws/tensorflow
make deepspeech
PREFIX=/usr/local sudo make install

Preparing language model

To generate language models, use KenLM

# Ubuntu
sudo apt-get install build-essential libboost-all-dev cmake zlib1g-dev libbz2-dev liblzma-dev 
# Mac OS
brew install cmake boost zlib

wget -O - https://kheafield.com/code/kenlm.tar.gz |tar xz
mkdir kenlm/build && cd kenlm/build
cmake ..
make -j 4
# Optionally, add bin to path
export PATH=$PATH:$HOME/kenlm/build/bin

Create the alphabet and vocabulary

python bin/generate_alphabet.py
python bin/generate_vocabulary.py

Create the arpa file for the binary build

lmplz --text data/tarteel/vocabulary.txt --arpa  data/tarteel/words.arpa --o 4
build_binary trie -q 16 -b 7 data/tarteel/words.arpa data/tarteel/lm.binary
# Assuming you compiled DeepSpeech
<path-to-deepspeech>/native_client/generate_trie data/tarteel/alphabet.txt \
                                                 data/tarteel/lm.binary \
                                                 data/tarteel/vocabulary.txt quran.trie

Usage

Use the -h/--help flag for more info on how to use each script.

Directories in the script need to be configured.

Contributing

Intersted in helping out? Reach out to [email protected]!

deepspeech-old's People

Contributors

piraka9011 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.