yandex_speechkit

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
yandex_speechkit [2019/11/06 15:11]
val
yandex_speechkit [2023/07/16 06:04]
val [В первый раз]
Line 2: Line 2:
  
   * [[https://​cloud.yandex.ru/​docs/​speechkit/​|Документация]]   * [[https://​cloud.yandex.ru/​docs/​speechkit/​|Документация]]
-  * [[https://​cloud.yandex.ru/​|Облако]]+  * [[https://console.cloud.yandex.ru/​|Консоль]] 
 + 
 +===== Создание платежного ​аккаунта ===== 
 + 
 +  * [[https://​console.cloud.yandex.ru/​billing]] 
 + 
 +===== Установка и инициализация yandex cli ===== 
 + 
 +  * [[https://​cloud.yandex.ru/​docs/​cli/​quickstart#​install]] 
  
 <​code>​ <​code>​
-$ yc config set token A...............................k+curl https://​storage.yandexcloud.net/​yandexcloud-yc/​install.sh | bash 
 +</​code>​ 
 + 
 +===== Инициализация yandex cli ===== 
 + 
 +  * [[https://​oauth.yandex.ru/​authorize?​response_type=token&​client_id=1a6990aa636648e9b2ef855fa7bec2fb|Получить OAuth token]] 
 + 
 +  * !!! Выполняется для учетной записи,​ а не для процесса 
 + 
 + 
 +==== В первый раз ==== 
 + 
 +<​code>​ 
 +$ $HOME/​yandex-cloud/​bin/​yc init 
 +Welcome! This command will take you through the configuration process. 
 +Please go to https://​oauth.yandex.ru/​authorize?​response_type=token&​client_id=1a6990aa636648e9b2ef855fa7bec2fb in order to obtain OAuth token. 
 + 
 +Please enter OAuth token: A.........................................I 
 + 
 +... 
 +Please choose folder to use: 
 + [1] default (id = b1gg4j6ru4esprat3uu7) 
 +...   1 
 +...   n 
 +</​code>​ 
 + 
 +==== После "​Выйти на всех устройствах"​ ==== 
 +<​code>​ 
 +$ $HOME/​yandex-cloud/​bin/​yc config set token A............................................I 
 + 
 +$ $HOME/​yandex-cloud/​bin/​yc config list 
 +</​code>​ 
 + 
 +===== Проверка распознавания речи ===== 
 + 
 +<​code>​ 
 +$ wget http://​val.bmstu.ru/​unix/​Media/​speech.ogg 
 +или 
 +$ mv -v /​usr/​share/​asterisk/​sounds/​recordings/​speech.ogg . 
 + 
 +$ IAM_TOKEN=`$HOME/​yandex-cloud/​bin/​yc iam create-token`
  
-export IAM_TOKEN=`yc iam create-token`+FOLDER_ID=b1gg4j6ru4esprat3uu7
  
-export FOLDER_ID=b1gmpublpjhm23dm8nfk+curl -s -X POST -H "​Authorization:​ Bearer ${IAM_TOKEN}"​ --data-binary "​@speech.ogg"​ \ 
 +     "​https://​stt.api.cloud.yandex.net/​speech/​v1/​stt:​recognize?​folderId=${FOLDER_ID}"​ \ 
 +     | jq '​.result'​ | tr -d '"'​
 </​code>​ </​code>​
yandex_speechkit.txt · Last modified: 2023/07/16 06:04 by val