<jupyter_start><jupyter_text>Install DeepSpeech<jupyter_code>#!pip install youtube-dl deepspeech-gpu
!pip install youtube-dl deepspeech<jupyter_output>Collecting youtube-dl
  Downloading youtube_dl-2021.6.6-py2.py3-none-any.whl (1.9 MB)
[K     |████████████████████████████████| 1.9 MB 22.7 MB/s 
[?25hCollecting deepspeech
  Downloading deepspeech-0.9.3-cp37-cp37m-manylinux1_x86_64.whl (9.2 MB)
[K     |████████████████████████████████| 9.2 MB 33.4 MB/s 
[?25hRequirement already satisfied: numpy>=1.14.5 in /usr/local/lib/python3.7/dist-packages (from deepspeech) (1.19.5)
Installing collected packages: youtube-dl, deepspeech
Successfully installed deepspeech-0.9.3 youtube-dl-2021.6.6<jupyter_text>Download Model<jupyter_code># Download pre-trained English model files
!curl -LO https://github.com/mozilla/DeepSpeech/releases/download/v0.9.3/deepspeech-0.9.3-models.pbmm
!curl -LO https://github.com/mozilla/DeepSpeech/releases/download/v0.9.3/deepspeech-0.9.3-models.scorer<jupyter_output>% Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   634  100   634    0     0   7731      0 --:--:-- --:--:-- --:--:--  7731
100  180M  100  180M    0     0   181M      0 --:--:-- --:--:-- --:--:--  205M
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   636  100   636    0     0  23555      0 --:--:-- --:--:-- --:--:-- 23555
100  909M  100  909M    0     0   209M      0  0:00:04  0:00:04 --:--:--  211M<jupyter_text>Download Audio<jupyter_code>!rm -fR audio_english.wav
!curl -LO https://github.com/scottykwok/cantonese-selfish-project/raw/master/audio/audio_english.wav

### Or download from Youtube
#!ffmpeg -i $(youtube-dl -f 18 --get-url https://www.youtube.com/watch?v=LTxMRQObjfs ) \
#  -ss 00:01:15 -to 00:01:30 -ar 16000 -ac 1 audio_english.wav
#!ffmpeg -i $(youtube-dl -f 18 --get-url https://www.youtube.com/watch?v=LTxMRQObjfs ) \
#  -ss 00:01:15 -to 00:01:59 -ar 16000 -ac 1 audio_english_46s.wav
# Preview the wav file
import IPython
IPython.display.Audio('audio_english.wav')<jupyter_output><empty_output><jupyter_text>Run DeepSpeech<jupyter_code>!deepspeech --model deepspeech-0.9.3-models.pbmm --scorer deepspeech-0.9.3-models.scorer --audio audio_english.wav<jupyter_output>Loading model from file deepspeech-0.9.3-models.pbmm
TensorFlow: v2.3.0-6-g23ad988
DeepSpeech: v0.9.3-0-gf2e9c85
2021-10-14 16:17:54.476808: I tensorflow/core/platform/cpu_feature_guard.cc:142] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN)to use the following CPU instructions in performance-critical operations:  AVX2 FMA
To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.
Loaded model in 0.0228s.
Loading scorer from files deepspeech-0.9.3-models.scorer
Loaded scorer in 0.00161s.
Running inference.
every one on this movie the care about the story whether it's a language a symbology everything was done with care with research we all bonded because it's just such an important filmore
Inference took 16.958s for 15.000s audio file.
{'fraction_non_alphanumeric': 0.14016089108910892, 'fraction_numerical': 0.08818069306930693, 'mean_word_length': 3.231675392670157, 'pattern_counts': {'":': 0, '<': 14, '<?xml version=': 0, '>': 15, 'https://': 5, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 10, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '654413', 'license': 'MIT', 'n_tokens_mistral': 1430, 'n_tokens_neox': 1200, 'n_words': 286, 'path': 'Part4_deepspeech/Run_DeepSpeech_English.ipynb', 'repo_name': 'scottykwok/cantonese-selfish-project', 'size': '3232'}