User Tools

Site Tools


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/18 14:56]
val [Установки и инициализация yandex cli]
yandex_speechkit [2023/07/16 06:04] (current)
val [В первый раз]
Line 4: Line 4:
   * [[https://​console.cloud.yandex.ru/​|Консоль]]   * [[https://​console.cloud.yandex.ru/​|Консоль]]
  
-===== Создать платежный аккаунт =====+===== Создание ​платежного ​аккаунта =====
  
   * [[https://​console.cloud.yandex.ru/​billing]]   * [[https://​console.cloud.yandex.ru/​billing]]
  
-===== Установки и инициализация yandex cli =====+===== Установка и инициализация yandex cli =====
  
   * [[https://​cloud.yandex.ru/​docs/​cli/​quickstart#​install]]   * [[https://​cloud.yandex.ru/​docs/​cli/​quickstart#​install]]
-  * [[https://​oauth.yandex.ru/​authorize?​response_type=token&​client_id=1a6990aa636648e9b2ef855fa7bec2fb|Получить OAuth token]]+
  
 <​code>​ <​code>​
 $ curl https://​storage.yandexcloud.net/​yandexcloud-yc/​install.sh | bash $ curl https://​storage.yandexcloud.net/​yandexcloud-yc/​install.sh | bash
 +</​code>​
  
-$ source "/​root/​.bashrc"​+===== Инициализация yandex cli =====
  
-$ yc init+  * [[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. 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 go to https://​oauth.yandex.ru/​authorize?​response_type=token&​client_id=1a6990aa636648e9b2ef855fa7bec2fb in order to obtain OAuth token.
  
-Please enter OAuth token: A.......................................k+Please enter OAuth token: A.........................................I 
 ... ...
 Please choose folder to use: Please choose folder to use:
- [1] default (id = b1gmpublpjhm23dm8nfk+ [1] default (id = b1gg4j6ru4esprat3uu7
-...+...   1 
 +...   n 
 +</​code>​
  
-После "​Выйти на всех устройствах" ​получаем через браузер новый OAuth token и задаем его: +==== После "​Выйти на всех устройствах" ​==== 
-$ yc config set token A.....................................k+<​code>​ 
 +$HOME/​yandex-cloud/​bin/​yc config set token A............................................I
  
-$ yc config list+$HOME/​yandex-cloud/​bin/​yc config list
 </​code>​ </​code>​
 +
 ===== Проверка распознавания речи ===== ===== Проверка распознавания речи =====
  
 <​code>​ <​code>​
-export ​IAM_TOKEN=`yc iam create-token`+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 ​FOLDER_ID=b1gmpublpjhm23dm8nfk+$ FOLDER_ID=b1gg4j6ru4esprat3uu7
  
-curl -X POST +curl -s -X POST -H "​Authorization:​ Bearer ${IAM_TOKEN}"​ --data-binary "​@speech.ogg"​ \ 
-     -H "​Authorization:​ Bearer ${IAM_TOKEN}" ​+     "​https://​stt.api.cloud.yandex.net/​speech/​v1/​stt:​recognize?​folderId=${FOLDER_ID}" ​
-     --data-binary "​@speech.ogg"​ \ +     | jq '​.result'​ | tr -d '"'​
-     "​https://​stt.api.cloud.yandex.net/​speech/​v1/​stt:​recognize?​folderId=${FOLDER_ID}"​+
 </​code>​ </​code>​
yandex_speechkit.1574078211.txt.gz · Last modified: 2019/11/18 14:56 by val