{ "cells": [ { "attachments": {}, "cell_type": "markdown", "id": "4d1e4157-e611-48b4-bf9a-b01aeff6db36", "metadata": {}, "source": [ "# __Using a Speech Recognition Model__" ] }, { "attachments": {}, "cell_type": "markdown", "id": "1e871628-b20d-468a-bd46-509c4b660938", "metadata": {}, "source": [ "- Tutorial Difficulty: ★☆☆☆☆\n", "- 5 min read\n", "- Languages: [SQL](https://en.wikipedia.org/wiki/SQL) (100%)\n", "- File Location: tutorial_en/thanosql_ml/audio_recognition/speech_recognition2.ipynb\n", "- References: [(AI-Hub) Korean voice data](https://aihub.or.kr/aihubdata/data/view.do?currMenu=115&topMenu=100&aihubDataSe=realm&dataSetSn=123), [whisper](https://github.com/openai/whisper)" ] }, { "attachments": {}, "cell_type": "markdown", "id": "d15a2fa0", "metadata": {}, "source": [ "## Tutorial Introduction\n", "\n", "
\n", "

Understanding Speech Recognition

\n", "

Speech recognition technology, also called computer speech recognition or speech-to-text, allows programs to process human speech into text format. Recently, it has been used in a wide range of fields such as automobiles, medical fields, and everyday life involving artificial intelligence speakers and smartphones. Recent Machine Learning Speech recognition technology utilizes algorithms that understand and process speech by integrating grammar, syntax, structure, and composition of audio and speech signals.

\n", "
\n", "\n", "
\n", "

Speech Recognition should not be confused with Voice Recognition, which focuses only on identifying the individual users' voices.

\n", "
\n", "\n", "Today, speech recognition technology is being applied in various industries. Advances in speech recognition technology have been expanding into automatic interpretation for simple travel to high-level business meetings. In addition, it has delved into fields such as speech synthesis technology, which acts as a virtual guide, mimicking the voice of a specific celebrity, and converting a predetermined fingerprint into a voice.\n", "\n", "__The following are examples and applications of the ThanoSQL speech recognition model.__\n", "\n", "- Speech recognition technology converts phone consultation data into text to enable customer sentiment analysis and consultation trend analysis. Using speech recognition technology, customer service representatives can improve their service by quickly receiving relevant information that answers customer inquiries.\n", "In addition, after consultation, the customer satisfaction trend can be analyzed even with the indirect measurement of customer satisfaction through sentiment analysis.\n", "\n", "- Using speech recognition technology, you can write notes faster than writing with a keyboard and instantly search for specific keywords even in long audio files.\n", "\n", "
\n", "

In This Tutorial

\n", "

👉 Whisper [Alec Radford et al. 2022] is a general-purpose speech recognition deep learning model released by OpenAI that supports learning on large datasets of various audio and is a multi-task model that enables both translation and transcription as well as multilingual speech recognition. It also performs well and is widely used for common speech recognition problems. In this tutorial, Whisper's speech recognition and translation into English will be performed.\n", "

\n", "
" ] }, { "attachments": {}, "cell_type": "markdown", "id": "3ec036c9-489c-4661-b5e2-4cbccef0b8cf", "metadata": {}, "source": [ "## __0. Prepare Dataset and Model__\n", "\n", "As mentioned in the [ThanoSQL Workspace](https://docs.thanosql.ai/1.4/en/getting_started/paas/workspace/lab/), you must create an API token and run the query below to execute the query of ThanoSQL. " ] }, { "cell_type": "code", "execution_count": null, "id": "a1a4f8dc", "metadata": { "tags": [] }, "outputs": [], "source": [ "%load_ext thanosql\n", "%thanosql API_TOKEN=" ] }, { "attachments": {}, "cell_type": "markdown", "id": "0bf08459", "metadata": {}, "source": [ "### __Prepare Dataset__" ] }, { "cell_type": "code", "execution_count": 2, "id": "fbd9757f", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Success\n" ] } ], "source": [ "%%thanosql\n", "GET THANOSQL DATASET korean_voice_data\n", "OPTIONS (overwrite=True)" ] }, { "attachments": {}, "cell_type": "markdown", "id": "58a5ecaf", "metadata": {}, "source": [ "
\n", "

Query Details

\n", " \n", "
" ] }, { "cell_type": "code", "execution_count": 3, "id": "15bd3bcb-ac55-4fb1-a591-9e0538d363f0", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Success\n" ] } ], "source": [ "%%thanosql\n", "COPY korean_voice\n", "OPTIONS (if_exists='replace')\n", "FROM 'thanosql-dataset/korean_voice_data/korean_voice.csv'" ] }, { "attachments": {}, "cell_type": "markdown", "id": "c727ada5", "metadata": {}, "source": [ "
\n", "

Query Details

\n", " \n", "
" ] }, { "attachments": {}, "cell_type": "markdown", "id": "b7a6c96d", "metadata": {}, "source": [ "### __Prepare the Model__" ] }, { "cell_type": "code", "execution_count": 4, "id": "ef951c9f", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Success\n" ] } ], "source": [ "%%thanosql\n", "GET THANOSQL MODEL whisper_s\n", "OPTIONS (\n", " model_name='tutorial_whisper_small',\n", " overwrite=True\n", " )" ] }, { "attachments": {}, "cell_type": "markdown", "id": "b6d1bee3-672a-4a2a-90cf-705ab8b8c4e3", "metadata": {}, "source": [ "
\n", "

Query Details

\n", " \n", "
" ] }, { "attachments": {}, "cell_type": "markdown", "id": "4cbb21b3", "metadata": {}, "source": [ "## __1. Check Dataset__\n", "\n", "For this tutorial, we use the __korean_voice__ table stored in the ThanoSQL workspace database. Execute the query below to check the contents of the table." ] }, { "cell_type": "code", "execution_count": 5, "id": "049828aa-8a83-40b3-9517-6cd5c35c876e", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
audio_pathsampling_ratetranscript_phonetictranscript_spellingduration
0thanosql-dataset/korean_voice_data/audio/broad...16000가를 보면 한국어 사용하는 인구 수가 십이 위입니다. 일위가 중국어고 이위가 스페인...가를 보면 한국어 사용하는 인구 수가 십이 위입니다. 일위가 중국어고 이위가 스페인...8.70
1thanosql-dataset/korean_voice_data/audio/broad...16000말을 사랑하고 아껴서 규정에 맞게 파괴하지 않고 네 잘.말을 사랑하고 아껴서 규정에 맞게 파괴하지 않고 네 잘.5.89
2thanosql-dataset/korean_voice_data/audio/broad...16000진행하고 있습니다. 자 오늘의 목표 확인해 보도록 하겠습니다. 오늘의 목표 네.진행하고 있습니다. 자 오늘의 목표 확인해 보도록 하겠습니다. 오늘의 목표 네.4.86
3thanosql-dataset/korean_voice_data/audio/broad...16000그리고 이번에는 다른 친구의 글을 평가해보는 것을 하는 겁니다.그리고 이번에는 다른 친구의 글을 평가해보는 것을 하는 겁니다.4.61
4thanosql-dataset/korean_voice_data/audio/broad...16000쓰기가 된 글 완성된 글 또는 쓰기 전의 개요 뭐 자료 이런 것들을 보여주면서 그것...쓰기가 된 글 완성된 글 또는 쓰기 전의 개요 뭐 자료 이런 것들을 보여주면서 그것...11.52
\n", "
" ], "text/plain": [ " audio_path sampling_rate \\\n", "0 thanosql-dataset/korean_voice_data/audio/broad... 16000 \n", "1 thanosql-dataset/korean_voice_data/audio/broad... 16000 \n", "2 thanosql-dataset/korean_voice_data/audio/broad... 16000 \n", "3 thanosql-dataset/korean_voice_data/audio/broad... 16000 \n", "4 thanosql-dataset/korean_voice_data/audio/broad... 16000 \n", "\n", " transcript_phonetic \\\n", "0 가를 보면 한국어 사용하는 인구 수가 십이 위입니다. 일위가 중국어고 이위가 스페인... \n", "1 말을 사랑하고 아껴서 규정에 맞게 파괴하지 않고 네 잘. \n", "2 진행하고 있습니다. 자 오늘의 목표 확인해 보도록 하겠습니다. 오늘의 목표 네. \n", "3 그리고 이번에는 다른 친구의 글을 평가해보는 것을 하는 겁니다. \n", "4 쓰기가 된 글 완성된 글 또는 쓰기 전의 개요 뭐 자료 이런 것들을 보여주면서 그것... \n", "\n", " transcript_spelling duration \n", "0 가를 보면 한국어 사용하는 인구 수가 십이 위입니다. 일위가 중국어고 이위가 스페인... 8.70 \n", "1 말을 사랑하고 아껴서 규정에 맞게 파괴하지 않고 네 잘. 5.89 \n", "2 진행하고 있습니다. 자 오늘의 목표 확인해 보도록 하겠습니다. 오늘의 목표 네. 4.86 \n", "3 그리고 이번에는 다른 친구의 글을 평가해보는 것을 하는 겁니다. 4.61 \n", "4 쓰기가 된 글 완성된 글 또는 쓰기 전의 개요 뭐 자료 이런 것들을 보여주면서 그것... 11.52 " ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "%%thanosql\n", "SELECT *\n", "FROM korean_voice\n", "LIMIT 5" ] }, { "attachments": {}, "cell_type": "markdown", "id": "9e9d609f", "metadata": {}, "source": [ "
\n", "

Understanding the Data Table

\n", "

korean_voice table contains the following information.

\n", " \n", "
" ] }, { "cell_type": "code", "execution_count": 6, "id": "ddeca28a-cbe5-4666-99ec-7dc2e47d4f16", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "/home/jovyan/thanosql-dataset/korean_voice_data/audio/broadcast_00033030.flac\n" ] }, { "data": { "text/html": [ "\n", " \n", " " ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "/home/jovyan/thanosql-dataset/korean_voice_data/audio/broadcast_00033057.flac\n" ] }, { "data": { "text/html": [ "\n", " \n", " " ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "/home/jovyan/thanosql-dataset/korean_voice_data/audio/broadcast_00033066.flac\n" ] }, { "data": { "text/html": [ "\n", " \n", " " ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "%%thanosql\n", "PRINT AUDIO\n", "AS\n", "SELECT audio_path\n", "FROM korean_voice\n", "LIMIT 3" ] }, { "attachments": {}, "cell_type": "markdown", "id": "38da606c-07f3-43ee-9e05-2de397d5cad9", "metadata": {}, "source": [ "## __2. Predict Using Pre-built Model__\n", "\n", "To transcribe the audio results using the __tutorial_whisper_small__ model, run the following query.\n", "\n", "- `task='transcribe'` When this option is specified, speech recognition is performed. " ] }, { "cell_type": "code", "execution_count": 7, "id": "5804d0ce-2311-49e8-9013-b32b17832a21", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
audio_pathsampling_ratetranscript_phonetictranscript_spellingdurationpredict_result
0thanosql-dataset/korean_voice_data/audio/broad...16000가를 보면 한국어 사용하는 인구 수가 십이 위입니다. 일위가 중국어고 이위가 스페인...가를 보면 한국어 사용하는 인구 수가 십이 위입니다. 일위가 중국어고 이위가 스페인...8.70가를 보면 한국어 사용하는 인구수가 12위입니다 1위가 중국어고 2위가 스페인어고 ...
1thanosql-dataset/korean_voice_data/audio/broad...16000말을 사랑하고 아껴서 규정에 맞게 파괴하지 않고 네 잘.말을 사랑하고 아껴서 규정에 맞게 파괴하지 않고 네 잘.5.89를 사랑하고 아껴서 규정에 맞게 파괴하지 않고 잘
2thanosql-dataset/korean_voice_data/audio/broad...16000진행하고 있습니다. 자 오늘의 목표 확인해 보도록 하겠습니다. 오늘의 목표 네.진행하고 있습니다. 자 오늘의 목표 확인해 보도록 하겠습니다. 오늘의 목표 네.4.86오늘의 목표 확인해보도록 하겠습니다.
3thanosql-dataset/korean_voice_data/audio/broad...16000그리고 이번에는 다른 친구의 글을 평가해보는 것을 하는 겁니다.그리고 이번에는 다른 친구의 글을 평가해보는 것을 하는 겁니다.4.61그리고 이번에는 다른 친구에게를 평가해 보는 것을 하는 겁니다
4thanosql-dataset/korean_voice_data/audio/broad...16000쓰기가 된 글 완성된 글 또는 쓰기 전의 개요 뭐 자료 이런 것들을 보여주면서 그것...쓰기가 된 글 완성된 글 또는 쓰기 전의 개요 뭐 자료 이런 것들을 보여주면서 그것...11.52쓰기가 될 글 완성된 글 또는 쓰기 전에 개요, 자료 이런 것들을 보여주면서 그것을...
.....................
95thanosql-dataset/korean_voice_data/audio/broad...16000희곡 같은 데서 제일 중요한 한 단어는 뭐라고요.희곡 같은 데서 제일 중요한 한 단어는 뭐라고요.3.20키곡 같은 데에서 제일 중요한 한 단어는 뭐라고요?
96thanosql-dataset/korean_voice_data/audio/broad...16000수필이라는 이름 자체가 무슨 뜻인지 아나요.수필이라는 이름 자체가 무슨 뜻인지 아나요.2.94수필이라는 이름 자체가 무슨 뜻인지 알아요?
97thanosql-dataset/korean_voice_data/audio/broad...16000당근 씨를 막 뿌리려는 남편에게 나는 몇 번이나 말했다 그랬습니다.당근 씨를 막 뿌리려는 남편에게 나는 몇 번이나 말했다 그랬습니다.3.58당근실을 막 뿌리려는 남편에게 나는 몇 번이나 말했다.
98thanosql-dataset/korean_voice_data/audio/broad...16000작년에도 너무 얕게 씨를 뿌려 낭패를 본 적이 있기 때문이다.작년에도 너무 얕게 씨를 뿌려 낭패를 본 적이 있기 때문이다.4.22작년에도 너무 얕게 씨를 뿌려 낭패를 본 적이 있기 때문이다.
99thanosql-dataset/korean_voice_data/audio/broad...16000하나는 새를 위해서 하나는 또.하나는 새를 위해서 하나는 또.2.69하나는 새, 하나는 또
\n", "

100 rows × 6 columns

\n", "
" ], "text/plain": [ " audio_path sampling_rate \\\n", "0 thanosql-dataset/korean_voice_data/audio/broad... 16000 \n", "1 thanosql-dataset/korean_voice_data/audio/broad... 16000 \n", "2 thanosql-dataset/korean_voice_data/audio/broad... 16000 \n", "3 thanosql-dataset/korean_voice_data/audio/broad... 16000 \n", "4 thanosql-dataset/korean_voice_data/audio/broad... 16000 \n", ".. ... ... \n", "95 thanosql-dataset/korean_voice_data/audio/broad... 16000 \n", "96 thanosql-dataset/korean_voice_data/audio/broad... 16000 \n", "97 thanosql-dataset/korean_voice_data/audio/broad... 16000 \n", "98 thanosql-dataset/korean_voice_data/audio/broad... 16000 \n", "99 thanosql-dataset/korean_voice_data/audio/broad... 16000 \n", "\n", " transcript_phonetic \\\n", "0 가를 보면 한국어 사용하는 인구 수가 십이 위입니다. 일위가 중국어고 이위가 스페인... \n", "1 말을 사랑하고 아껴서 규정에 맞게 파괴하지 않고 네 잘. \n", "2 진행하고 있습니다. 자 오늘의 목표 확인해 보도록 하겠습니다. 오늘의 목표 네. \n", "3 그리고 이번에는 다른 친구의 글을 평가해보는 것을 하는 겁니다. \n", "4 쓰기가 된 글 완성된 글 또는 쓰기 전의 개요 뭐 자료 이런 것들을 보여주면서 그것... \n", ".. ... \n", "95 희곡 같은 데서 제일 중요한 한 단어는 뭐라고요. \n", "96 수필이라는 이름 자체가 무슨 뜻인지 아나요. \n", "97 당근 씨를 막 뿌리려는 남편에게 나는 몇 번이나 말했다 그랬습니다. \n", "98 작년에도 너무 얕게 씨를 뿌려 낭패를 본 적이 있기 때문이다. \n", "99 하나는 새를 위해서 하나는 또. \n", "\n", " transcript_spelling duration \\\n", "0 가를 보면 한국어 사용하는 인구 수가 십이 위입니다. 일위가 중국어고 이위가 스페인... 8.70 \n", "1 말을 사랑하고 아껴서 규정에 맞게 파괴하지 않고 네 잘. 5.89 \n", "2 진행하고 있습니다. 자 오늘의 목표 확인해 보도록 하겠습니다. 오늘의 목표 네. 4.86 \n", "3 그리고 이번에는 다른 친구의 글을 평가해보는 것을 하는 겁니다. 4.61 \n", "4 쓰기가 된 글 완성된 글 또는 쓰기 전의 개요 뭐 자료 이런 것들을 보여주면서 그것... 11.52 \n", ".. ... ... \n", "95 희곡 같은 데서 제일 중요한 한 단어는 뭐라고요. 3.20 \n", "96 수필이라는 이름 자체가 무슨 뜻인지 아나요. 2.94 \n", "97 당근 씨를 막 뿌리려는 남편에게 나는 몇 번이나 말했다 그랬습니다. 3.58 \n", "98 작년에도 너무 얕게 씨를 뿌려 낭패를 본 적이 있기 때문이다. 4.22 \n", "99 하나는 새를 위해서 하나는 또. 2.69 \n", "\n", " predict_result \n", "0 가를 보면 한국어 사용하는 인구수가 12위입니다 1위가 중국어고 2위가 스페인어고 ... \n", "1 를 사랑하고 아껴서 규정에 맞게 파괴하지 않고 잘 \n", "2 오늘의 목표 확인해보도록 하겠습니다. \n", "3 그리고 이번에는 다른 친구에게를 평가해 보는 것을 하는 겁니다 \n", "4 쓰기가 될 글 완성된 글 또는 쓰기 전에 개요, 자료 이런 것들을 보여주면서 그것을... \n", ".. ... \n", "95 키곡 같은 데에서 제일 중요한 한 단어는 뭐라고요? \n", "96 수필이라는 이름 자체가 무슨 뜻인지 알아요? \n", "97 당근실을 막 뿌리려는 남편에게 나는 몇 번이나 말했다. \n", "98 작년에도 너무 얕게 씨를 뿌려 낭패를 본 적이 있기 때문이다. \n", "99 하나는 새, 하나는 또 \n", "\n", "[100 rows x 6 columns]" ] }, "execution_count": 7, "metadata": {}, "output_type": "execute_result" } ], "source": [ "%%thanosql\n", "PREDICT USING tutorial_whisper_small\n", "OPTIONS (\n", " audio_col='audio_path',\n", " language='auto',\n", " task='transcribe',\n", " result_col='predict_result'\n", " )\n", "AS\n", "SELECT *\n", "FROM korean_voice" ] }, { "attachments": {}, "cell_type": "markdown", "id": "3cbdd7c7-98db-4c21-bc8d-a488e15a2264", "metadata": {}, "source": [ "
\n", "

Query Details

\n", "
    \n", "
  • \"PREDICT USING\" predicts the outcome using the tutorial_whisper_small.\n", "
  • \"OPTIONS\" specifies the option values to be used for prediction.\n", "
      \n", "
    • \"audio_col\": the name of the column containing the audio path to be used for prediction (str, default: 'audio_path')
    • \n", "
    • \"batch_size\": the size of the dataset bundle read during a single train (int, optional, default: 16)
    • \n", "
    • \"language\": specifies the language of the audio file. If selected as ‘auto’, the model will recognize the language from the available pool of 99 languages (str, default: 'auto')
    • \n", "
    • \"task\": type of work to do (str, 'transcribe'|'translate', default: 'transcribe')
    • \n", "
    • \"result_col\": the column that contains the predicted results (str, optional, default: 'predict_result')
    • \n", "
    \n", "
  • \n", "
\n", "
" ] }, { "attachments": {}, "cell_type": "markdown", "id": "e8fcbacd-0913-403e-a715-dd425491181e", "metadata": {}, "source": [ "## __3. Translate to English Using Pre-built Model__\n", "\n", "To auto-translate the audio results using the __tutorial_whisper_small__ model, run the following query.\n", "\n", "- `task='translate'` When this option is specified, speech recognition is performed. This process translates \"Korean speech\" directly into \"English text,\" which is different from general translations in that it does not require the extra step of using \"Korean text\" during the process." ] }, { "cell_type": "code", "execution_count": 8, "id": "0ef8ffaf-40e4-4ae1-b872-d5fafd9c9f4f", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
audio_pathsampling_ratetranscript_phonetictranscript_spellingdurationpredict_result
0thanosql-dataset/korean_voice_data/audio/broad...16000가를 보면 한국어 사용하는 인구 수가 십이 위입니다. 일위가 중국어고 이위가 스페인...가를 보면 한국어 사용하는 인구 수가 십이 위입니다. 일위가 중국어고 이위가 스페인...8.70The number of people using Korean is 12.
1thanosql-dataset/korean_voice_data/audio/broad...16000말을 사랑하고 아껴서 규정에 맞게 파괴하지 않고 네 잘.말을 사랑하고 아껴서 규정에 맞게 파괴하지 않고 네 잘.5.89Love and cherish the words and don't destroy t...
2thanosql-dataset/korean_voice_data/audio/broad...16000진행하고 있습니다. 자 오늘의 목표 확인해 보도록 하겠습니다. 오늘의 목표 네.진행하고 있습니다. 자 오늘의 목표 확인해 보도록 하겠습니다. 오늘의 목표 네.4.86Let's check today's goal.
3thanosql-dataset/korean_voice_data/audio/broad...16000그리고 이번에는 다른 친구의 글을 평가해보는 것을 하는 겁니다.그리고 이번에는 다른 친구의 글을 평가해보는 것을 하는 겁니다.4.61And this time, I'm going to evaluate other fri...
4thanosql-dataset/korean_voice_data/audio/broad...16000쓰기가 된 글 완성된 글 또는 쓰기 전의 개요 뭐 자료 이런 것들을 보여주면서 그것...쓰기가 된 글 완성된 글 또는 쓰기 전의 개요 뭐 자료 이런 것들을 보여주면서 그것...11.52It is a problem of the order and writing area.
.....................
95thanosql-dataset/korean_voice_data/audio/broad...16000당근 씨를 막 뿌리려는 남편에게 나는 몇 번이나 말했다 그랬습니다.당근 씨를 막 뿌리려는 남편에게 나는 몇 번이나 말했다 그랬습니다.3.58I told my husband that I would pour carrots a ...
96thanosql-dataset/korean_voice_data/audio/broad...16000작년에도 너무 얕게 씨를 뿌려 낭패를 본 적이 있기 때문이다.작년에도 너무 얕게 씨를 뿌려 낭패를 본 적이 있기 때문이다.4.22I've seen a lot of people who put too little s...
97thanosql-dataset/korean_voice_data/audio/broad...16000하나는 새를 위해서 하나는 또.하나는 새를 위해서 하나는 또.2.69One is for the new year. Another is for the ne...
98thanosql-dataset/korean_voice_data/audio/broad...16000많이 씨앗들을 넣어가지고 너무 촘촘하게 여러 개가 한꺼번에 자라는 거야 여러 줄기가.많이 씨앗들을 넣어가지고 너무 촘촘하게 여러 개가 한꺼번에 자라는 거야 여러 줄기가.6.14I put a lot of seeds in it and it grew into a ...
99thanosql-dataset/korean_voice_data/audio/broad...16000텃밭 농사짓는 정도일 겁니다.텃밭 농사짓는 정도일 겁니다.2.30It's about the same as the picture in the Tupp...
\n", "

100 rows × 6 columns

\n", "
" ], "text/plain": [ " audio_path sampling_rate \\\n", "0 thanosql-dataset/korean_voice_data/audio/broad... 16000 \n", "1 thanosql-dataset/korean_voice_data/audio/broad... 16000 \n", "2 thanosql-dataset/korean_voice_data/audio/broad... 16000 \n", "3 thanosql-dataset/korean_voice_data/audio/broad... 16000 \n", "4 thanosql-dataset/korean_voice_data/audio/broad... 16000 \n", ".. ... ... \n", "95 thanosql-dataset/korean_voice_data/audio/broad... 16000 \n", "96 thanosql-dataset/korean_voice_data/audio/broad... 16000 \n", "97 thanosql-dataset/korean_voice_data/audio/broad... 16000 \n", "98 thanosql-dataset/korean_voice_data/audio/broad... 16000 \n", "99 thanosql-dataset/korean_voice_data/audio/broad... 16000 \n", "\n", " transcript_phonetic \\\n", "0 가를 보면 한국어 사용하는 인구 수가 십이 위입니다. 일위가 중국어고 이위가 스페인... \n", "1 말을 사랑하고 아껴서 규정에 맞게 파괴하지 않고 네 잘. \n", "2 진행하고 있습니다. 자 오늘의 목표 확인해 보도록 하겠습니다. 오늘의 목표 네. \n", "3 그리고 이번에는 다른 친구의 글을 평가해보는 것을 하는 겁니다. \n", "4 쓰기가 된 글 완성된 글 또는 쓰기 전의 개요 뭐 자료 이런 것들을 보여주면서 그것... \n", ".. ... \n", "95 당근 씨를 막 뿌리려는 남편에게 나는 몇 번이나 말했다 그랬습니다. \n", "96 작년에도 너무 얕게 씨를 뿌려 낭패를 본 적이 있기 때문이다. \n", "97 하나는 새를 위해서 하나는 또. \n", "98 많이 씨앗들을 넣어가지고 너무 촘촘하게 여러 개가 한꺼번에 자라는 거야 여러 줄기가. \n", "99 텃밭 농사짓는 정도일 겁니다. \n", "\n", " transcript_spelling duration \\\n", "0 가를 보면 한국어 사용하는 인구 수가 십이 위입니다. 일위가 중국어고 이위가 스페인... 8.70 \n", "1 말을 사랑하고 아껴서 규정에 맞게 파괴하지 않고 네 잘. 5.89 \n", "2 진행하고 있습니다. 자 오늘의 목표 확인해 보도록 하겠습니다. 오늘의 목표 네. 4.86 \n", "3 그리고 이번에는 다른 친구의 글을 평가해보는 것을 하는 겁니다. 4.61 \n", "4 쓰기가 된 글 완성된 글 또는 쓰기 전의 개요 뭐 자료 이런 것들을 보여주면서 그것... 11.52 \n", ".. ... ... \n", "95 당근 씨를 막 뿌리려는 남편에게 나는 몇 번이나 말했다 그랬습니다. 3.58 \n", "96 작년에도 너무 얕게 씨를 뿌려 낭패를 본 적이 있기 때문이다. 4.22 \n", "97 하나는 새를 위해서 하나는 또. 2.69 \n", "98 많이 씨앗들을 넣어가지고 너무 촘촘하게 여러 개가 한꺼번에 자라는 거야 여러 줄기가. 6.14 \n", "99 텃밭 농사짓는 정도일 겁니다. 2.30 \n", "\n", " predict_result \n", "0 The number of people using Korean is 12. \n", "1 Love and cherish the words and don't destroy t... \n", "2 Let's check today's goal. \n", "3 And this time, I'm going to evaluate other fri... \n", "4 It is a problem of the order and writing area. \n", ".. ... \n", "95 I told my husband that I would pour carrots a ... \n", "96 I've seen a lot of people who put too little s... \n", "97 One is for the new year. Another is for the ne... \n", "98 I put a lot of seeds in it and it grew into a ... \n", "99 It's about the same as the picture in the Tupp... \n", "\n", "[100 rows x 6 columns]" ] }, "execution_count": 8, "metadata": {}, "output_type": "execute_result" } ], "source": [ "%%thanosql\n", "PREDICT USING tutorial_whisper_small\n", "OPTIONS (\n", " audio_col='audio_path',\n", " language='auto',\n", " task='translate',\n", " result_col='predict_result'\n", " )\n", "AS\n", "SELECT *\n", "FROM korean_voice" ] }, { "attachments": {}, "cell_type": "markdown", "id": "6a1b50c4-b9a7-4bb1-b914-5e54098afeba", "metadata": {}, "source": [ "
\n", "

Query Details

\n", "
    \n", "
  • \"PREDICT USING\" predicts the outcome using the tutorial_whisper_small.\n", "
  • \"OPTIONS\" specifies the option values to be used for prediction.\n", "
      \n", "
    • \"audio_col\": the name of the column containing the audio path to be used for prediction (str, default: 'audio_path')
    • \n", "
    • \"batch_size\": the size of the dataset bundle read during a single train (int, optional, default: 16)
    • \n", "
    • \"language\": specifies the language of the audio file. If selected as ‘auto’, the model will recognize the language from the available pool of 99 languages (str, default: 'auto')
    • \n", "
    • \"task\": type of work to do (str, 'transcribe'|'translate', default: 'transcribe')
    • \n", "
    • \"result_col\": the column that contains the predicted results (str, optional, default: 'predict_result')
    • \n", "
    \n", "
  • \n", "
\n", "
" ] }, { "attachments": {}, "cell_type": "markdown", "id": "3c05cd4c", "metadata": {}, "source": [ "## __4. In Conclusion__\n", " \n", "In this tutorial, we used the __Whisper__ model for speech recognition and translation using the korean_voice dataset. As this is a beginner-level tutorial, we focused on the process rather than accuracy.\n", "\n", "* [How to Upload My Data to the ThanoSQL Workspace](https://docs.thanosql.ai/1.4/en/getting_started/data_upload/)\n", "* [How to Create a Table Using My Data](https://docs.thanosql.ai/1.4/en/how-to_guides/ThanoSQL_query/COPY_SYNTAX/)\n", "* [How to Upload My Model to the ThanoSQL Workspace](https://docs.thanosql.ai/1.4/en/how-to_guides/ThanoSQL_query/UPLOAD_MODEL_SYNTAX/)\n", "\n", "
\n", "

Inquiries About Deploying a Model for Your Own Service

\n", "

If you have any difficulties creating your own model using ThanoSQL or applying it to your service, please feel free to contact us below😊

\n", "

For inquiries regarding building a speech recognition model: contact@smartmind.team

\n", "
" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.8.10 (default, Nov 14 2022, 12:59:47) \n[GCC 9.4.0]" }, "vscode": { "interpreter": { "hash": "916dbcbb3f70747c44a77c7bcd40155683ae19c65e1c03b4aa3499c5328201f1" } } }, "nbformat": 4, "nbformat_minor": 5 }