Twitterã¹ãã¼ã¹ã®é²é³ãCloud Speech-to-Textã使ã£ã¦æåèµ·ããããã¾ã§
ã¡ãã£ã¨é å¼µã£ãã®ã§ãèªåï¼å¨å²ã使ãããã¦ãã¦å ±æã¡ã¢ãTwitterã¹ãã¼ã¹ã®é²é³ã¯å ¬éãã¼ã¿ã§æ©å¯æ å ±ã§ã¯ãªãããããããå ¨é¨ãªã³ã©ã¤ã³ã®ãµã¼ãã¹ã使ã£ã¦ããã
- Twitterã¹ãã¼ã¹ã®é²é³ããã¦ã³ãã¼ããã
- é²é³ãã¡ã¤ã«ãGoogleã®Cloud Speech-to-Textã«æ¾ãè¾¼ããããã«å å·¥ãã
- Googleã®Cloud Speech-to-Textã使ã£ã¦å¤æãã
Twitterã¹ãã¼ã¹ã®é²é³ããã¦ã³ãã¼ããã
録音スペース - Twitterスペース - プロダクト | Twitter Create
ç¾å¨ã端æ«ã«ã¹ãã¼ã¹ã®é²é³ãé³å£°ãã¡ã¤ã«ã¨ãã¦ç´æ¥ãã¦ã³ãã¼ããããã¨ã¯ã§ãã¾ããããã ãããã¹ãã¯é²é³ãåé¤ãã¦ããªãéããã¹ãã¼ã¹ã®é²é³ã®ã³ãã¼ãTwitterã®ãã¼ã¿ã¢ã¼ã«ã¤ããã.tsãã¡ã¤ã«ã§ãã¤ã§ãåå¾ã§ãã¾ãããã®ãã¡ã¤ã«ã¯.mp3ã.wavãªã©ã®é³å£°ãã¡ã¤ã«ã ãã§ãªããåç»ãã¡ã¤ã«ã«ãç°¡åã«å¤æã§ãã¾ãã
ã¨ã®ãã¨ãªã®ã§ãæ¯åãã¼ã¿ã¢ã¼ã«ã¤ãã®ãã¦ã³ãã¼ããªã¯ã¨ã¹ãããã¦ã該å½ã®.tsãã¡ã¤ã«ãæ¢ãããã¡ã¤ã«åã ãã ã¨ä½æã®ãã®ãåããã¥ããã®ã§ããã¼ã¿ã¢ã¼ã«ã¤ãã®è©²å½ã¹ãã¼ã¹ãåç §ããã
ããã®t.coãã®ãªã³ã¯ãéãã¨ããã¡ã¤ã«åãåç
§ã§ããã
é²é³ãã¡ã¤ã«ãå å·¥ãã
.ts ãã¡ã¤ã«ã .wavå½¢å¼ã«ãã
Googleã®Cloud Speech-to-Textã¯.tså½¢å¼ã§ã¯NGãªã®ã§ãWAVå½¢å¼ã«ãã
WAVå½¢å¼ã«ãã¤ã¤ããã£ã³ãã«æ°ã¯1ãå¨æ³¢æ°ã¯44100ãæéãé²é³éå§ããã«åãåãã
ããã§ãã¡ã¤ã«åãå¤æ´ãã
次ã®ã¹ãããã§ãã¡ã¤ã«åå²ãããã¨ãå ã®ãã¡ã¤ã«åã«é£çªã®ãµãã£ãã¯ã¹ä»ãå½åè¦åã«ãªãã®ã§ãããã§ãã¡ã¤ã«åãå¤æ´ãã¦ããã
space_yyyymmdd.wav ãªã©ã
é²é³ã®WAVãã¡ã¤ã«ãåå²ãã
Cloud Speech-to-Textã®60ç§å¶ç´ã¨ãpythonå®è¡ç°å¢ã¨ããGoogle Colabã®ã¡ã¢ãªå¶éã«å¼ã£ããããªãããã«ãé²é³WAVãã¡ã¤ã«ã55ç§ãã¨ã«åå²ããã
オーディオファイルオンラインアプリの分割-無料のオンラインWAVファイルスプリッター
ããã§é²é³ããé³å£°ãã¡ã¤ã«ã®å å·¥ã¯çµäºã
Googleã®Cloud Speech-to-Textã使ã£ã¦é³å£°ãã¡ã¤ã«ãããã¹ãã«å¤æãã
Google Driveã¨Google ColabããCloud Speech-to-Textã使ã£ã¦å¤æããæé ã¯ä¸è¨ã®ãµã¤ããåç §ã
【音声認識】GCPのCloud Speech-to-Text APIを利用して音声認識入門してみた - Qiita
æå¾ãå¤æãå®æ½ããã¨ããã ãåå²ããWAVãã¡ã¤ã«ã1å1åãã£ã¦ããã ããã®ã§ãã«ã¼ãå¦çã追å ãã
import io from google.cloud import speech for i in range(1, 31, 1): voice_file_path = 'yyyymmdd/space_'+str(i)+'.wav' with io.open(voice_file_path, 'rb') as f: content = f.read() audio = speech.RecognitionAudio(content=content) config = speech.RecognitionConfig( encoding=speech.RecognitionConfig.AudioEncoding.LINEAR16, sample_rate_hertz=44100, language_code='ja-JP') client = speech.SpeechClient() response = client.recognize(config=config, audio=audio) for result in response.results: print(result.alternatives[0].transcript)
Speech to Textå®äºï¼ãæ©æ¢°ãèãåãããããã®åãæ¹ãå¿æãã¾ãããï¼ãã¾ããï¼