{ "cells": [ { "attachments": {}, "cell_type": "markdown", "id": "6cfd2a8c-fdfc-4233-abd1-ece097069522", "metadata": {}, "source": [ "# __오디오 파일을 받아쓰는 음성 인식 모델 만들기__" ] }, { "attachments": {}, "cell_type": "markdown", "id": "c0c52c4a-aec4-45e9-88eb-7225e03a6b4b", "metadata": {}, "source": [ "- 튜토리얼 난이도: ★☆☆☆☆\n", "- 읽는데 걸리는 시간: 10분\n", "- 사용 언어: [SQL](https://ko.wikipedia.org/wiki/SQL) (100%)\n", "- 실행 파일 위치: tutorial/thanosql_ml/audio_recognition/speech_recognition.ipynb\n", "- 참고 문서: [LibriSpeech 데이터 세트](http://www.openslr.org/12), [wav2vec 2.0: A Framework for Self-Supervised Learning of Speech Representations](https://arxiv.org/abs/2006.11477)" ] }, { "attachments": {}, "cell_type": "markdown", "id": "78e7b326-4786-4fd2-a801-d22aff1ddb3d", "metadata": {}, "source": [ "## 튜토리얼 소개\n", "\n", "
\n", "

음성 인식 기술 이해하기

\n", "

컴퓨터 음성 인식 또는 음성-텍스트 변환(Speech-to-Text)이라고도 부르는 음성 인식 기술은 프로그램이 사람의 음성을 텍스트 형식으로 처리할 수 있도록 해줍니다. 최근 자동차, 의료 분야, 인공지능 스피커나 스마트폰을 이용한 일상 생활까지 광범위한 분야에서 활용되고 있습니다. 최근 머신러닝(기계학습/Machine Learning) 알고리즘을 활용한 음성 인식 기술은 문법, 구문, 구조, 오디오와 음성 신호의 구성을 통합하여 음성을 이해하고 처리합니다.

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

일반적으로 음성 인식(Voice Recognition)과 혼동 될 수 있는데, 음성 인식은 개별 사용자의 목소리를 식별하는 데만 집중합니다.

\n", "
\n", "\n", "오늘날 음성 인식 기술은 다양한 산업 분야에서 응용되고 있습니다. 음성 인식 기술의 발전은 단순 여행용 자동 통역에서 난이도가 높은 비즈니스 회의 통역까지 확대되고 있습니다. 또한, 음성 인식 기술은 음성 합성 기술로 발전하여 가상 안내원이나 비서 역할을 수행하기도 하고 특정 연예인이나 유명인의 목소리를 흉내내어 정해진 지문을 목소리로 변환하기도 하며 응용되고 있습니다.\n", "\n", "__아래는 ThanoSQL 음성 인식 모델의 활용 및 예시입니다.__\n", "\n", "- 음성 인식 기술은 전화 상담 데이터를 텍스트로 변환하여 고객의 감정 분석이나 상담 트렌드 분석 등을 가능하게 합니다. 상담자는 음성 인식 기술을 통해, 고객의 문의에 대한 답변이 되는 정보나 과거의 유사 사례 등을 빠르게 제공받아 고객 상담을 개선할 수 있습니다.\n", "또한, 상담 종료 후에는 음성으로 저장되어 있는 데이터를 활용하여 감정 분석을 통해 고객의 만족도 등을 간접적으로 측정하여 트렌드 별 고객의 만족도를 확인할 수 있습니다.\n", "- 음성 인식 기술을 사용하면 키보드로 작성하는 메모보다 빠르게 작성이 가능하고, 긴 음성 파일에서도 빠르게 특정 키워드를 검색 할 수 있습니다.\n", "\n", "
\n", "

본 튜토리얼에서는

\n", "

👉 Librispeech [Panayotov et al. 2015]는 음성인식 연구에 있어서 가장 널리 사용되는 대규모 영어 음성 데이터 중 하나로 사용자 참여형 오디오북 프로젝트인 LibriVox project의 결과물입니다. 16kHz로 샘플링된 약 1,000시간 분량의 녹음된 오디오북 데이터를 가공하여 만들었습니다. 튜토리얼을 위한 대상 테이블은 미리 업로드 된 음성 파일의 경로와 스크립트로 구성되어 있습니다. 본 튜토리얼은 음성 파일을 텍스트로 변환하는 것을 목표로 하고 있습니다.

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

튜토리얼 주의 사항

\n", " \n", "
" ] }, { "attachments": {}, "cell_type": "markdown", "id": "4d5a038e-2951-433a-b5b2-2cc0cf439d2e", "metadata": {}, "source": [ "## __0. 데이터 세트 및 모델 준비__\n", "\n", "ThanoSQL의 쿼리 구문을 사용하기 위해서는 [ThanoSQL 워크스페이스](https://docs.thanosql.ai/1.5/ko/getting_started/paas/workspace/lab/)에서 언급된 것처럼 API 토큰을 생성하고 아래의 쿼리를 실행해야 합니다." ] }, { "cell_type": "code", "execution_count": null, "id": "9cb93ef5-7309-4842-b616-f8269965db46", "metadata": {}, "outputs": [], "source": [ "%load_ext thanosql\n", "%thanosql API_TOKEN=<발급받은_API_TOKEN>" ] }, { "attachments": {}, "cell_type": "markdown", "id": "a3fc89e5-600a-4c5f-bba2-289a425db405", "metadata": {}, "source": [ "### __데이터 세트 준비__" ] }, { "cell_type": "code", "execution_count": 2, "id": "ad07a885-ee2e-4eeb-a2f0-634af9b3b843", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Success\n" ] } ], "source": [ "%%thanosql\n", "GET THANOSQL DATASET librispeech_data\n", "OPTIONS (overwrite=True)" ] }, { "attachments": {}, "cell_type": "markdown", "id": "77319ae0", "metadata": {}, "source": [ "
\n", "

쿼리 세부 정보

\n", " \n", "
" ] }, { "cell_type": "code", "execution_count": 3, "id": "784d86c0-984b-4df7-a46c-b8c2294e4e99", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Success\n" ] } ], "source": [ "%%thanosql\n", "COPY librispeech_train\n", "OPTIONS (if_exists='replace')\n", "FROM 'thanosql-dataset/librispeech_data/librispeech_train.csv'" ] }, { "cell_type": "code", "execution_count": 4, "id": "ebe4e8d3-bbd6-4fcb-92f2-0f6263612af6", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Success\n" ] } ], "source": [ "%%thanosql\n", "COPY librispeech_test\n", "OPTIONS (if_exists='replace')\n", "FROM 'thanosql-dataset/librispeech_data/librispeech_test.csv'" ] }, { "attachments": {}, "cell_type": "markdown", "id": "984aefd3", "metadata": {}, "source": [ "
\n", "

쿼리 세부 정보

\n", " \n", "
" ] }, { "attachments": {}, "cell_type": "markdown", "id": "bfab432b-32e0-4352-97cd-b9f2efd17640", "metadata": {}, "source": [ "### __모델 준비__" ] }, { "cell_type": "code", "execution_count": 5, "id": "ca098b9e-2b48-4965-9fd9-e58df2252472", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Success\n" ] } ], "source": [ "%%thanosql\n", "GET THANOSQL MODEL wav2vec2\n", "OPTIONS (\n", " model_name='tutorial_audio_recognition',\n", " overwrite=True\n", " )" ] }, { "attachments": {}, "cell_type": "markdown", "id": "93766820", "metadata": {}, "source": [ "
\n", "

쿼리 세부 정보

\n", " \n", "
" ] }, { "attachments": {}, "cell_type": "markdown", "id": "e557a156-1075-41df-b19f-ff0812a14b4c", "metadata": {}, "source": [ "## __1. 데이터 세트 확인__\n", "\n", "음성 인식 모델을 만들기 위해 ThanoSQL 워크스페이스 데이터베이스에 저장되어 있는 __librispeech_train__ 테이블을 사용합니다. 아래의 쿼리 구문을 실행하고 테이블의 내용을 확인합니다." ] }, { "cell_type": "code", "execution_count": 6, "id": "49d801df-54d2-4809-bbed-69b2818e9cec", "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", "
audio_pathtext
0thanosql-dataset/librispeech_data/000.wavi noticed how white and well shaped his own ha...
1thanosql-dataset/librispeech_data/001.wavthe only conflicts that occurred on irish soil...
2thanosql-dataset/librispeech_data/002.wavinquired shaggy in the metal forest
3thanosql-dataset/librispeech_data/003.wavmy grandmother always spoke in a very loud ton...
4thanosql-dataset/librispeech_data/004.wavthe poets of succeeding ages have dwelt much i...
\n", "
" ], "text/plain": [ " audio_path \\\n", "0 thanosql-dataset/librispeech_data/000.wav \n", "1 thanosql-dataset/librispeech_data/001.wav \n", "2 thanosql-dataset/librispeech_data/002.wav \n", "3 thanosql-dataset/librispeech_data/003.wav \n", "4 thanosql-dataset/librispeech_data/004.wav \n", "\n", " text \n", "0 i noticed how white and well shaped his own ha... \n", "1 the only conflicts that occurred on irish soil... \n", "2 inquired shaggy in the metal forest \n", "3 my grandmother always spoke in a very loud ton... \n", "4 the poets of succeeding ages have dwelt much i... " ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ "%%thanosql\n", "SELECT *\n", "FROM librispeech_train\n", "LIMIT 5" ] }, { "attachments": {}, "cell_type": "markdown", "id": "ff864330", "metadata": {}, "source": [ "
\n", "

데이터 테이블 이해하기

\n", "

librispeech_train 테이블은 아래와 같은 정보를 담고 있습니다.

\n", " \n", "
" ] }, { "cell_type": "code", "execution_count": 7, "id": "41d7b7cc-e411-4e39-b443-1aa287a0adff", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "/home/jovyan/thanosql-dataset/librispeech_data/000.wav\n" ] }, { "data": { "text/html": [ "\n", " \n", " " ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "/home/jovyan/thanosql-dataset/librispeech_data/001.wav\n" ] }, { "data": { "text/html": [ "\n", " \n", " " ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "/home/jovyan/thanosql-dataset/librispeech_data/002.wav\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 librispeech_train\n", "LIMIT 3" ] }, { "attachments": {}, "cell_type": "markdown", "id": "b3251b51-e9d8-4c5c-9882-46ca1c5d58bd", "metadata": {}, "source": [ "## __2. 사전 학습된 모델을 사용하여 음성 인식 결과 예측__\n", "\n", "다음 쿼리 구문을 실행하여 __tutorial_audio_recognition__ 모델을 사용하여 결과를 예측합니다." ] }, { "cell_type": "code", "execution_count": 8, "id": "ef603c7d-ac80-4918-bb9d-d4abe3e07d03", "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", "
audio_pathtextpredict_result
0thanosql-dataset/librispeech_data/000.wavi noticed how white and well shaped his own ha...I NOTICED HOW WHITE AND WELL SHAPED HIS OWN HA...
1thanosql-dataset/librispeech_data/001.wavthe only conflicts that occurred on irish soil...THE ONLY CONFLICTS THAT OCCURRED ON IRISH SOIL...
2thanosql-dataset/librispeech_data/002.wavinquired shaggy in the metal forestINQUIRED SHAGGY IN THE MEDAL FOREST
3thanosql-dataset/librispeech_data/003.wavmy grandmother always spoke in a very loud ton...MY GRANDMOTHER ALWAYS SPOKE IN A VERY LOUD TON...
4thanosql-dataset/librispeech_data/004.wavthe poets of succeeding ages have dwelt much i...THE POETS OF SUCCEEDING AGES HAVE DWELT MUCH I...
............
75thanosql-dataset/librispeech_data/075.wavwe can't do anything without evidence complainWE CAN'T DO ANYTHING WITHOUT EVIDENCE COMPLAIN
76thanosql-dataset/librispeech_data/076.wavwhen i came up he touched my shoulder and look...WHEN I CAME UP HE TOUCHED MY SHOULDER AND LOOK...
77thanosql-dataset/librispeech_data/077.wavit relieved him for a whileIT RELIEVED HIM FOR A WHILE
78thanosql-dataset/librispeech_data/078.wavthis world's thick vapours whelm your eyes unw...THIS WORLD'S THICK VAPOURS WHELM YOUR EYES UNW...
79thanosql-dataset/librispeech_data/079.wavi began to enjoy the exhilarating delight of t...I BEGAN TO ENJOY THE EXHILARATING DELIGHT OF T...
\n", "

80 rows × 3 columns

\n", "
" ], "text/plain": [ " audio_path \\\n", "0 thanosql-dataset/librispeech_data/000.wav \n", "1 thanosql-dataset/librispeech_data/001.wav \n", "2 thanosql-dataset/librispeech_data/002.wav \n", "3 thanosql-dataset/librispeech_data/003.wav \n", "4 thanosql-dataset/librispeech_data/004.wav \n", ".. ... \n", "75 thanosql-dataset/librispeech_data/075.wav \n", "76 thanosql-dataset/librispeech_data/076.wav \n", "77 thanosql-dataset/librispeech_data/077.wav \n", "78 thanosql-dataset/librispeech_data/078.wav \n", "79 thanosql-dataset/librispeech_data/079.wav \n", "\n", " text \\\n", "0 i noticed how white and well shaped his own ha... \n", "1 the only conflicts that occurred on irish soil... \n", "2 inquired shaggy in the metal forest \n", "3 my grandmother always spoke in a very loud ton... \n", "4 the poets of succeeding ages have dwelt much i... \n", ".. ... \n", "75 we can't do anything without evidence complain \n", "76 when i came up he touched my shoulder and look... \n", "77 it relieved him for a while \n", "78 this world's thick vapours whelm your eyes unw... \n", "79 i began to enjoy the exhilarating delight of t... \n", "\n", " predict_result \n", "0 I NOTICED HOW WHITE AND WELL SHAPED HIS OWN HA... \n", "1 THE ONLY CONFLICTS THAT OCCURRED ON IRISH SOIL... \n", "2 INQUIRED SHAGGY IN THE MEDAL FOREST \n", "3 MY GRANDMOTHER ALWAYS SPOKE IN A VERY LOUD TON... \n", "4 THE POETS OF SUCCEEDING AGES HAVE DWELT MUCH I... \n", ".. ... \n", "75 WE CAN'T DO ANYTHING WITHOUT EVIDENCE COMPLAIN \n", "76 WHEN I CAME UP HE TOUCHED MY SHOULDER AND LOOK... \n", "77 IT RELIEVED HIM FOR A WHILE \n", "78 THIS WORLD'S THICK VAPOURS WHELM YOUR EYES UNW... \n", "79 I BEGAN TO ENJOY THE EXHILARATING DELIGHT OF T... \n", "\n", "[80 rows x 3 columns]" ] }, "execution_count": 8, "metadata": {}, "output_type": "execute_result" } ], "source": [ "%%thanosql\n", "PREDICT USING tutorial_audio_recognition\n", "OPTIONS (\n", " audio_col='audio_path',\n", " batch_size=8\n", " )\n", "AS\n", "SELECT *\n", "FROM librispeech_train" ] }, { "attachments": {}, "cell_type": "markdown", "id": "e9b4137e-75ad-4bea-bda0-0c7fcdb3b72b", "metadata": { "tags": [] }, "source": [ "## __3. 음성 인식 모델 생성__\n", "\n", "이전 단계에서 확인한 __librispeech_train__ 테이블을 사용하여 음성 인식 모델을 만듭니다. 아래의 쿼리 구문을 실행하여 my_speech_recognition_model이라는 이름의 모델을 만듭니다. \n", "(쿼리 실행 시 예상 소요 시간: 1 min)" ] }, { "cell_type": "code", "execution_count": 9, "id": "8ffb0317-476e-409f-baa3-dc562d924e99", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Success\n" ] } ], "source": [ "%%thanosql\n", "BUILD MODEL my_speech_recognition_model\n", "USING Wav2Vec2En\n", "OPTIONS (\n", " audio_col='audio_path',\n", " text_col='text',\n", " max_epochs=1,\n", " batch_size=4,\n", " overwrite= True\n", " )\n", "AS\n", "SELECT *\n", "FROM librispeech_train" ] }, { "attachments": {}, "cell_type": "markdown", "id": "9e61e174", "metadata": {}, "source": [ "
\n", "

쿼리 세부 정보

\n", "
    \n", "
  • \"BUILD MODEL\" 쿼리 구문을 사용하여 my_speech_recognition_model이라는 모델을 만들고 학습시킵니다.
  • \n", "
  • \"USING\" 쿼리 구문을 통해 베이스 모델로 Wav2Vec2En을 사용할 것을 명시합니다.
  • \n", "
  • \"OPTIONS\" 쿼리 구문을 통해 모델 생성에 사용할 옵션을 지정합니다.\n", "
      \n", "
    • \"audio_col\": 학습에 사용할 오디오의 경로가 기록되어 있는 컬럼의 이름 (str, default: 'audio_path')
    • \n", "
    • \"text_col\": 오디오의 스크립트 정보를 담은 컬럼의 이름 (str, default: 'text')
    • \n", "
    • \"max_epochs\": 모든 학습 데이터 세트를 학습하는 횟수 (int, optional, default: 5)
    • \n", "
    • \"batch_size\": 한 번의 학습에서 읽는 데이터 세트 묶음의 크기 (int, optional, default: 16)
    • \n", "
    • \"overwrite\": 동일 이름의 모델이 존재하는 경우 덮어쓰기 가능 여부 설정. True일 경우 기존 모델은 새로운 모델로 변경됨 (bool, optional, True|False, default: False)
    • \n", "
    \n", "
  • \n", "
\n", "
\n", "\n", "
\n", "

여기서는 빠르게 학습하기 위해 \"max_epochs\"를 1로 지정했습니다. 일반적으로 숫자가 클수록 많은 계산 시간이 소요되지만 학습이 진행됨에 따라 예측 성능이 올라갑니다.

\n", "
" ] }, { "attachments": {}, "cell_type": "markdown", "id": "d6402263-ff45-45e8-b221-27c1ff97c556", "metadata": {}, "source": [ "## __4. 생성된 모델을 사용하여 음성 인식 결과 예측__\n", "\n", "이전 단계에서 생성한 음성 인식 모델을 사용해 특정 음성을 예측해 봅니다. 테스트용 데이터 세트(학습에 이용되지 않은 데이터 테이블, librispeech_test)를 사용합니다." ] }, { "cell_type": "code", "execution_count": 10, "id": "530b828d-962c-4115-a417-59ca2c621e98", "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", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
audio_pathtextpredict_result
0thanosql-dataset/librispeech_data/080.wavdead said doctor macklewainDEAD SAID DOCTOR MACKELWAINE
1thanosql-dataset/librispeech_data/081.wavone day when i rode over to the shimerdas i fo...ONE DAY WHEN I RODE OVER TO THE SHIMERIDASI FO...
2thanosql-dataset/librispeech_data/082.wavwell i don't think you should turn a guy's t v...WELL I DON'T THINK YOU SHOULD TURN A GUYSE TEE...
3thanosql-dataset/librispeech_data/083.wavand what allurements or what vantages upon the...AND WHAT ALLUREMENTS OR WHAT VANTAGES UPON THE...
4thanosql-dataset/librispeech_data/084.wavyes how manyYE S HOW MANY
5thanosql-dataset/librispeech_data/085.wavthen i look perhaps like what i amTHEN I LOOK PERHAPS LIKE WHAT I AM
6thanosql-dataset/librispeech_data/086.wavi'm mister christopher from londonI MISTER CHRISTOPHER FROM LONDON
7thanosql-dataset/librispeech_data/087.wavnature a difference of fifty years had set a p...NATUREA DIFFERENCE OF FIFTY YEARSHAD SET A PRO...
8thanosql-dataset/librispeech_data/088.wavhe is just married you know is he said burgessHE IS JUST MARRIED YOU KNOWIS HE SAID BURGES
9thanosql-dataset/librispeech_data/089.wavshe pointed into the gold cottonwood tree behi...SHE POINTED IN TO THE GOLD COTTON WOOD TREE BE...
10thanosql-dataset/librispeech_data/090.wavand she saw the other birds hopping about and ...AND SHE SAW ALL THE OTHER BIRDS HOPPING ABOUT ...
11thanosql-dataset/librispeech_data/091.wavalways but it's worse nowALWAYS BUT IT'S WORSE NOW
12thanosql-dataset/librispeech_data/092.wavweek followed week these two beings led a happ...WEEK FOLLOWED WEEK THESE TWO BEINGSLED A HAPPY...
13thanosql-dataset/librispeech_data/093.wavgwynplaine was a mountebankGWYNPLAINE WAS A MOUNTE BANK
14thanosql-dataset/librispeech_data/094.wavthe coals in the grate settled down with a sli...THE COALS IN THE GRATE SETTLED DOWN WITH A SLI...
15thanosql-dataset/librispeech_data/095.wavi've decided to enlist in the armyI'VE DECIDED TO ENLIST IN THE ARMY
16thanosql-dataset/librispeech_data/096.wavi also offered to help your brother to escape ...I ALSO OFFERED TO HELP YOUR BRO THER TO ESCAPE...
17thanosql-dataset/librispeech_data/097.wavwell now said meekin with asperity i don't agr...WELL NOW SAID MIKON WITH ASPERITYI DON'T AGREE...
18thanosql-dataset/librispeech_data/098.wavlittle did i expect however the spectacle whic...LITTLE DID I EXPECT HOWEVERTHE SPECTACLE WHICH...
19thanosql-dataset/librispeech_data/099.wavi look at my watch it's a quarter to elevenA LOOK AT MY WATCHIT'S A QUARTER TO ELEVEN
\n", "
" ], "text/plain": [ " audio_path \\\n", "0 thanosql-dataset/librispeech_data/080.wav \n", "1 thanosql-dataset/librispeech_data/081.wav \n", "2 thanosql-dataset/librispeech_data/082.wav \n", "3 thanosql-dataset/librispeech_data/083.wav \n", "4 thanosql-dataset/librispeech_data/084.wav \n", "5 thanosql-dataset/librispeech_data/085.wav \n", "6 thanosql-dataset/librispeech_data/086.wav \n", "7 thanosql-dataset/librispeech_data/087.wav \n", "8 thanosql-dataset/librispeech_data/088.wav \n", "9 thanosql-dataset/librispeech_data/089.wav \n", "10 thanosql-dataset/librispeech_data/090.wav \n", "11 thanosql-dataset/librispeech_data/091.wav \n", "12 thanosql-dataset/librispeech_data/092.wav \n", "13 thanosql-dataset/librispeech_data/093.wav \n", "14 thanosql-dataset/librispeech_data/094.wav \n", "15 thanosql-dataset/librispeech_data/095.wav \n", "16 thanosql-dataset/librispeech_data/096.wav \n", "17 thanosql-dataset/librispeech_data/097.wav \n", "18 thanosql-dataset/librispeech_data/098.wav \n", "19 thanosql-dataset/librispeech_data/099.wav \n", "\n", " text \\\n", "0 dead said doctor macklewain \n", "1 one day when i rode over to the shimerdas i fo... \n", "2 well i don't think you should turn a guy's t v... \n", "3 and what allurements or what vantages upon the... \n", "4 yes how many \n", "5 then i look perhaps like what i am \n", "6 i'm mister christopher from london \n", "7 nature a difference of fifty years had set a p... \n", "8 he is just married you know is he said burgess \n", "9 she pointed into the gold cottonwood tree behi... \n", "10 and she saw the other birds hopping about and ... \n", "11 always but it's worse now \n", "12 week followed week these two beings led a happ... \n", "13 gwynplaine was a mountebank \n", "14 the coals in the grate settled down with a sli... \n", "15 i've decided to enlist in the army \n", "16 i also offered to help your brother to escape ... \n", "17 well now said meekin with asperity i don't agr... \n", "18 little did i expect however the spectacle whic... \n", "19 i look at my watch it's a quarter to eleven \n", "\n", " predict_result \n", "0 DEAD SAID DOCTOR MACKELWAINE \n", "1 ONE DAY WHEN I RODE OVER TO THE SHIMERIDASI FO... \n", "2 WELL I DON'T THINK YOU SHOULD TURN A GUYSE TEE... \n", "3 AND WHAT ALLUREMENTS OR WHAT VANTAGES UPON THE... \n", "4 YE S HOW MANY \n", "5 THEN I LOOK PERHAPS LIKE WHAT I AM \n", "6 I MISTER CHRISTOPHER FROM LONDON \n", "7 NATUREA DIFFERENCE OF FIFTY YEARSHAD SET A PRO... \n", "8 HE IS JUST MARRIED YOU KNOWIS HE SAID BURGES \n", "9 SHE POINTED IN TO THE GOLD COTTON WOOD TREE BE... \n", "10 AND SHE SAW ALL THE OTHER BIRDS HOPPING ABOUT ... \n", "11 ALWAYS BUT IT'S WORSE NOW \n", "12 WEEK FOLLOWED WEEK THESE TWO BEINGSLED A HAPPY... \n", "13 GWYNPLAINE WAS A MOUNTE BANK \n", "14 THE COALS IN THE GRATE SETTLED DOWN WITH A SLI... \n", "15 I'VE DECIDED TO ENLIST IN THE ARMY \n", "16 I ALSO OFFERED TO HELP YOUR BRO THER TO ESCAPE... \n", "17 WELL NOW SAID MIKON WITH ASPERITYI DON'T AGREE... \n", "18 LITTLE DID I EXPECT HOWEVERTHE SPECTACLE WHICH... \n", "19 A LOOK AT MY WATCHIT'S A QUARTER TO ELEVEN " ] }, "execution_count": 10, "metadata": {}, "output_type": "execute_result" } ], "source": [ "%%thanosql\n", "PREDICT USING my_speech_recognition_model\n", "OPTIONS (\n", " audio_col='audio_path',\n", " result_col='predict_result'\n", " )\n", "AS\n", "SELECT *\n", "FROM librispeech_test" ] }, { "attachments": {}, "cell_type": "markdown", "id": "da7d9847", "metadata": {}, "source": [ "
\n", "

쿼리 세부 정보

\n", "
    \n", "
  • \"PREDICT USING\" 쿼리 구문을 사용하여 이전 단계에서 만든 my_speech_recognition_model 모델을 예측에 사용합니다.
  • \n", "
  • \"OPTIONS\" 쿼리 구문을 통해 예측에 사용할 옵션을 지정합니다.\n", "
      \n", "
    • \"audio_col\": 예측에 사용할 오디오의 경로가 기록되어 있는 컬럼의 이름 (str, default: 'audio_path')
    • \n", "
    • \"result_col\": 데이터 테이블에서 예측 결과를 담을 컬럼 이름 (str, optional, default: 'predict_result')
    • \n", "
    \n", "
  • \n", "
\n", "
" ] }, { "attachments": {}, "cell_type": "markdown", "id": "dfa185ed", "metadata": {}, "source": [ "## __5. 튜토리얼을 마치며__\n", "\n", "이번 튜토리얼에서는 LibriSpeech 데이터 세트를 사용하여 음성 인식 모델을 만들어 보았습니다. 초급 단계 튜토리얼인 만큼 정확도 향상을 위한 과정 설명보다는 작동 위주의 설명으로 진행했습니다. 음성 인식 모델은 각 플랫폼이나 서비스에 맞는 정밀한 튜닝을 통해 정확도를 향상 시킬 수 있습니다. 나만의 데이터를 이용해서 베이스 모델을 학습을 진행하고 성능을 향상시켜 보세요. 다양한 비정형 데이터(이미지, 비디오, 텍스트 등)와 수치형 데이터들을 결합하여 나만의 모델을 만들고 경쟁력있는 서비스를 만들 수 있습니다.\n", "\n", "* [나만의 데이터 업로드하기](https://docs.thanosql.ai/1.5/ko/getting_started/data_upload/)\n", "* [나만의 데이터 테이블 생성하기](https://docs.thanosql.ai/1.5/ko/how-to_guides/ThanoSQL_query/COPY_SYNTAX/)\n", "* [나만의 모델 업로드하기](https://docs.thanosql.ai/1.5/ko/how-to_guides/ThanoSQL_query/UPLOAD_MODEL_SYNTAX/)\n", "\n", "
\n", "

나만의 서비스를 위한 모델 배포 관련 문의

\n", "

ThanoSQL을 활용해 나만의 모델을 만들거나, 나의 서비스에 적용하는데 어려움이 있다면 언제든 아래로 문의주세요😊

\n", "

음성 인식 모델 구축 관련 문의: 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]" }, "toc-autonumbering": false, "vscode": { "interpreter": { "hash": "916dbcbb3f70747c44a77c7bcd40155683ae19c65e1c03b4aa3499c5328201f1" } } }, "nbformat": 4, "nbformat_minor": 5 }