Chirp 是 Google 新一代的語音轉文字模型,經過多年研究,Chirp 的第一個版本現已支援語音轉文字功能。我們打算改善 Chirp,並擴大支援更多語言和領域。詳情請參閱「Google USM」一文。
我們訓練 Chirp 模型時,使用的架構與目前的語音模型不同。單一模型可整合多種語言的資料。不過,使用者仍須指定模型應辨識的語言。Chirp 不支援其他模型提供的部分 Google 語音功能。如需完整清單,請參閱「功能支援與限制」。
型號 ID
Chirp 適用於 Speech-to-Text API V2。使用方式與其他模型相同。
Chirp 的模型 ID 為:chirp
。
可用的 API 方法
Chirp 處理語音時,會將語音切分成比其他模型更大的區塊,因此可能不適合用於真正的即時用途。您可以使用下列 API 方法存取 Chirp:
v2
Speech.Recognize
(適合短音訊,長度不到 1 分鐘)v2
Speech.BatchRecognize
(適合 1 分鐘到 8 小時的長篇音訊)
下列 API 方法不支援 Chirp:
v2
Speech.StreamingRecognize
v1
Speech.StreamingRecognize
v1
Speech.Recognize
v1
Speech.LongRunningRecognize
v1p1beta1
Speech.StreamingRecognize
v1p1beta1
Speech.Recognize
v1p1beta1
Speech.LongRunningRecognize
區域
Chirp 適用於下列區域:
us-central1
europe-west4
asia-southeast1
詳情請參閱語言頁面。
語言
如要查看支援的語言,請參閱完整語言清單。
功能支援與限制
Chirp 不支援部分 STT API 功能:
- 信心分數:API 會傳回值,但並非真正的信心分數。
- 語音調整:不支援任何調整功能。
- 說話者區分:系統不支援自動區分說話者。
- 強制正規化:不支援。
- 個別字詞信心值:不支援。
- 語言偵測:不支援。
Chirp 支援下列功能:
- 自動加上標點符號:標點符號由模型預測。這個機制可停用。
- 單字時間碼:可選擇是否傳回。
- 不限語言的音訊轉錄:模型會自動推斷音訊檔案中使用的語言,並將其加入結果。
事前準備
- Sign in to your Google Cloud account. If you're new to Google Cloud, create an account to evaluate how our products perform in real-world scenarios. New customers also get $300 in free credits to run, test, and deploy workloads.
-
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
-
Make sure that billing is enabled for your Google Cloud project.
-
Enable the Speech-to-Text APIs.
-
Make sure that you have the following role or roles on the project: Cloud Speech Administrator
Check for the roles
-
In the Google Cloud console, go to the IAM page.
Go to IAM - Select the project.
-
In the Principal column, find all rows that identify you or a group that you're included in. To learn which groups you're included in, contact your administrator.
- For all rows that specify or include you, check the Role column to see whether the list of roles includes the required roles.
Grant the roles
-
In the Google Cloud console, go to the IAM page.
前往「IAM」頁面 - 選取專案。
- 按一下「授予存取權」 。
-
在「New principals」(新增主體) 欄位中,輸入您的使用者 ID。 這通常是 Google 帳戶的電子郵件地址。
- 在「Select a role」(選取角色) 清單中,選取角色。
- 如要授予其他角色,請按一下 「新增其他角色」,然後新增每個其他角色。
- 按一下 [Save]。
Install the Google Cloud CLI.
-
-
If you're using an external identity provider (IdP), you must first sign in to the gcloud CLI with your federated identity.
-
To initialize the gcloud CLI, run the following command:
gcloud init
-
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
-
Make sure that billing is enabled for your Google Cloud project.
-
Enable the Speech-to-Text APIs.
-
Make sure that you have the following role or roles on the project: Cloud Speech Administrator
Check for the roles
-
In the Google Cloud console, go to the IAM page.
Go to IAM - Select the project.
-
In the Principal column, find all rows that identify you or a group that you're included in. To learn which groups you're included in, contact your administrator.
- For all rows that specify or include you, check the Role column to see whether the list of roles includes the required roles.
Grant the roles
-
In the Google Cloud console, go to the IAM page.
前往「IAM」頁面 - 選取專案。
- 按一下「授予存取權」 。
-
在「New principals」(新增主體) 欄位中,輸入您的使用者 ID。 這通常是 Google 帳戶的電子郵件地址。
- 在「Select a role」(選取角色) 清單中,選取角色。
- 如要授予其他角色,請按一下 「新增其他角色」,然後新增每個其他角色。
- 按一下 [Save]。
Install the Google Cloud CLI.
-
-
If you're using an external identity provider (IdP), you must first sign in to the gcloud CLI with your federated identity.
-
To initialize the gcloud CLI, run the following command:
gcloud init
-
If you're using a local shell, then create local authentication credentials for your user account:
gcloud auth application-default login
You don't need to do this if you're using Cloud Shell.
If an authentication error is returned, and you are using an external identity provider (IdP), confirm that you have signed in to the gcloud CLI with your federated identity.
- 確認您已註冊 Google Cloud 帳戶並建立專案。
- 前往 Google Cloud 控制台的「Speech」頁面。
- 如果尚未啟用,請啟用 API。
- 前往「轉錄稿」子頁面。
- 按一下「新增語音轉錄作業」
請確認您有 STT 工作區。如果沒有,請建立一個。
開啟「工作區」下拉式選單,然後按一下「新工作區」。
在「建立新工作區」導覽側欄中,按一下「瀏覽」。
按一下即可建立值區。
輸入值區名稱,然後按一下「繼續」。
點選「建立」。
建立值區後,按一下「選取」選取值區。
按一下「建立」,完成建立語音轉文字工作區。
轉錄音訊。
- 在「新增轉錄稿」頁面中,選擇選取音訊檔案的方式:
- 按一下「本機上傳」即可上傳。
- 按一下「雲端儲存空間」,指定現有的 Cloud Storage 檔案。
- 按一下「繼續」。
在「轉錄選項」部分,從先前建立的辨識器中,選取您打算用來透過 Chirp 辨識的「說話語言」。
在「模型」* 下拉式選單中,選取「Chirp」。
在「Region」(區域) 下拉式選單中,選取區域,例如「us-central1」。
按一下「繼續」。
如要使用 Chirp 執行第一個辨識要求,請在主要部分中按一下「提交」。
- 在「新增轉錄稿」頁面中,選擇選取音訊檔案的方式:
查看 Chirp 轉錄結果。
在「轉錄稿」頁面中,按一下轉錄稿名稱。
在「轉錄詳細資料」頁面中查看轉錄結果,並視需要透過瀏覽器播放音訊。
-
Optional: Revoke the authentication credentials that you created, and delete the local credential file.
gcloud auth application-default revoke
-
Optional: Revoke credentials from the gcloud CLI.
gcloud auth revoke
- In the Google Cloud console, go to the Manage resources page.
- In the project list, select the project that you want to delete, and then click Delete.
- In the dialog, type the project ID, and then click Shut down to delete the project.
用戶端程式庫可以使用應用程式預設憑證,輕鬆向 Google API 進行驗證,然後傳送要求給這些 API。使用應用程式預設憑證,您可以在本機測試及部署應用程式,不必變更基礎程式碼。詳情請參閱「 驗證以使用用戶端程式庫」。
此外,請確認您已安裝用戶端程式庫。
使用 Chirp 執行同步語音辨識
以下是對本機音訊檔案執行同步語音辨識的範例 (使用 Chirp):
Python
提出要求並啟用不限語言的轉錄功能
下列程式碼範例示範如何發出要求,並啟用不限語言的轉錄功能。
Python
在 Google Cloud 控制台中開始使用 Chirp
清除所用資源
如要避免系統向您的 Google Cloud 帳戶收取本頁所用資源的費用,請按照下列步驟操作。
控制台
gcloud
Delete a Google Cloud project:
gcloud projects delete PROJECT_ID