Speech-to-Text API - Thai NLP Meetup #24. Google Speech-to-Text
• เดิมชื่อ Speech API เปลี่ยนเป็น Speech-to-Text
• กลุ่ม Cloud ML แบบเรียกใช้สำเร็จ
• ASR: Automatic Speech Recognition
• รองรับ 120 ภาษา (มากที่สุด)
• ตัวเลือกอื่น: Nuance, AmiVoice, Tellvoice
(MS, AWS ไม่มีภาษาไทย)
5. ความสามารถ
• แปลงเสียง เป็น Text ใน 3 mode
• Synchronous (สั้น)
• Asynchronous (ยาว)
• Streaming (real-time)
• ใช้ผ่าน Library, gcloud, curl
7. ราคา
• ฟรี 60 นาที/เดือน
• เสียงพูด $0.006 = 0.20฿ ต่อ 15 sec
• วิดีโอ x2 เท่า
• เช่น ถอดเทป 1 ชั่วโมง ≈ 50 บาท
12. Import & Install
• from IPython.display import HTML, Audio
• !pip install youtube-dl
• !pip install pydub !apt install ffmpeg
• !pip install google-cloud-speech
• from google.cloud import
speech_v1p1beta1 as speech
13. youtube-dl
• Download from YouTube in many formats
• !youtube-dl -F [youtube_url] ดู formats
• !youtube-dl -f bestaudio -o ‘audio.%(ext)s’ [url]
16. Cloud Authentication
• Register Google Cloud (free $200 credit)
• Create a new project
• Enable Speech API for the project
• Download credential file, save to Google Drive
• Load credential file into Colab, set environment
24. Next
• client.long_running_recognize()
• คำยากๆ ที่สะกดผิด เก็บสถิติแล้ว correct
• context hint ด้วย speechContexts phrases
(500 คำ)
• speech analysis (waveform, spectrogram) เพื่อ
correct boundary
• เอา label ไป train ASR เช่น KALDI, Deep Speech