Cosmetic notebook changes
This commit is contained in:
parent
2729da33a8
commit
cbd3db9d28
@ -37,7 +37,7 @@
|
|||||||
"\n",
|
"\n",
|
||||||
"👋 Hello and welcome to Coqui (🐸) STT \n",
|
"👋 Hello and welcome to Coqui (🐸) STT \n",
|
||||||
"\n",
|
"\n",
|
||||||
"The goal of this notebook is to show you a **typical workflow** for **training** and **testing** an STT model with 🐸 and data from Common Voice.\n",
|
"This notebook shows a **typical workflow** for **training** and **testing** an 🐸 STT model on data from Common Voice.\n",
|
||||||
"\n",
|
"\n",
|
||||||
"In this notebook, we will:\n",
|
"In this notebook, we will:\n",
|
||||||
"\n",
|
"\n",
|
||||||
@ -74,21 +74,15 @@
|
|||||||
"id": "be5fe49c"
|
"id": "be5fe49c"
|
||||||
},
|
},
|
||||||
"source": [
|
"source": [
|
||||||
"## ✅ Download & format sample data for English\n",
|
"## ✅ Download & format sample data for Serbian\n",
|
||||||
"\n",
|
"\n",
|
||||||
"**First things first**: we need some data.\n",
|
"**First things first**: we need some data.\n",
|
||||||
"\n",
|
"\n",
|
||||||
"We're training a Speech-to-Text model, so we need some _speech_ and we need some _text_. Specificially, we want _transcribed speech_. Let's download some audio and transcripts.\n",
|
"We're training a Speech-to-Text model, so we want _speech_ and we want _text_. Specificially, we want _transcribed speech_. Let's download some audio and transcripts.\n",
|
||||||
"\n",
|
|
||||||
"🐸 STT expects to find information about your data in a CSV file, where each line contains:\n",
|
|
||||||
"\n",
|
|
||||||
"1. the **path** to an audio file\n",
|
|
||||||
"2. the **size** of that audio file\n",
|
|
||||||
"3. the **transcript** of that audio file.\n",
|
|
||||||
"\n",
|
"\n",
|
||||||
"To focus on model training, we formatted the Common Voice data for you already, and you will find CSV files for `{train,test,dev}.csv` in the data directory.\n",
|
"To focus on model training, we formatted the Common Voice data for you already, and you will find CSV files for `{train,test,dev}.csv` in the data directory.\n",
|
||||||
"\n",
|
"\n",
|
||||||
"Let's train a speech-to-text model 😊\n"
|
"Let's download some data for Serbian 😊\n"
|
||||||
],
|
],
|
||||||
"id": "be5fe49c"
|
"id": "be5fe49c"
|
||||||
},
|
},
|
||||||
@ -105,14 +99,15 @@
|
|||||||
"from coqui_stt_training.util.downloader import maybe_download\n",
|
"from coqui_stt_training.util.downloader import maybe_download\n",
|
||||||
"\n",
|
"\n",
|
||||||
"def download_preformatted_data():\n",
|
"def download_preformatted_data():\n",
|
||||||
" if not os.path.exists(\"data/sr-data\"):\n",
|
" if not os.path.exists(\"sr-data\"):\n",
|
||||||
" maybe_download(\"sr-data.tar\", \"data/\", \"https://coqui-ai-public-data.s3.amazonaws.com/cv/7.0/sr-data.tar\")\n",
|
" maybe_download(\"sr-data.tar\", \".\", \"https://coqui-ai-public-data.s3.amazonaws.com/cv/7.0/sr-data.tar\")\n",
|
||||||
" print('\\nNo extracted data found. Extracting now...')\n",
|
" print('\\nExtracting data...')\n",
|
||||||
" tar = tarfile.open(\"data/sr-data.tar\", mode=\"r:\")\n",
|
" tar = tarfile.open(\"sr-data.tar\", mode=\"r:\")\n",
|
||||||
" tar.extractall(\"data/\")\n",
|
" tar.extractall(\".\")\n",
|
||||||
" tar.close()\n",
|
" tar.close()\n",
|
||||||
|
" print('\\nFinished extracting data...')\n",
|
||||||
" else:\n",
|
" else:\n",
|
||||||
" print('Found \"data/sr-data\" - not extracting.')\n",
|
" print('Found data - not extracting.')\n",
|
||||||
"\n",
|
"\n",
|
||||||
"# Download + extract Common Voice data\n",
|
"# Download + extract Common Voice data\n",
|
||||||
"download_preformatted_data()"
|
"download_preformatted_data()"
|
||||||
@ -134,8 +129,8 @@
|
|||||||
"id": "fa2aec77"
|
"id": "fa2aec77"
|
||||||
},
|
},
|
||||||
"source": [
|
"source": [
|
||||||
"! ls data/sr-data\n",
|
"! ls sr-data\n",
|
||||||
"! wc -l data/sr-data/*.csv"
|
"! wc -l sr-data/*.csv"
|
||||||
],
|
],
|
||||||
"id": "fa2aec77",
|
"id": "fa2aec77",
|
||||||
"execution_count": null,
|
"execution_count": null,
|
||||||
@ -166,9 +161,9 @@
|
|||||||
"from coqui_stt_training.util.config import initialize_globals_from_args\n",
|
"from coqui_stt_training.util.config import initialize_globals_from_args\n",
|
||||||
"\n",
|
"\n",
|
||||||
"initialize_globals_from_args(\n",
|
"initialize_globals_from_args(\n",
|
||||||
" train_files=[\"data/sr-data/train.csv\"],\n",
|
" train_files=[\"sr-data/train.csv\"],\n",
|
||||||
" dev_files=[\"data/sr-data/dev.csv\"],\n",
|
" dev_files=[\"sr-data/dev.csv\"],\n",
|
||||||
" test_files=[\"data/sr-data/test.csv\"],\n",
|
" test_files=[\"sr-data/test.csv\"],\n",
|
||||||
" load_train=\"init\",\n",
|
" load_train=\"init\",\n",
|
||||||
" n_hidden=200,\n",
|
" n_hidden=200,\n",
|
||||||
" epochs=1,\n",
|
" epochs=1,\n",
|
||||||
@ -214,9 +209,7 @@
|
|||||||
"source": [
|
"source": [
|
||||||
"## ✅ Train a new model\n",
|
"## ✅ Train a new model\n",
|
||||||
"\n",
|
"\n",
|
||||||
"Let's kick off a training run 🚀🚀🚀 (using the configure you set above).\n",
|
"Let's kick off a training run 🚀🚀🚀 (using the configure you set above).",
|
||||||
"\n",
|
|
||||||
"This notebook should work on either a GPU or a CPU. However, in case you're running this on _multiple_ GPUs we want to only use one, because the sample dataset (one audio file) is too small to split across multiple GPUs."
|
|
||||||
],
|
],
|
||||||
"id": "ae82fd75"
|
"id": "ae82fd75"
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user