Questa pagina descrive come ottenere la punteggiatura automatica nei risultati della trascrizione di Speech-to-Text. Quando attivi questa funzionalità, Speech-to-Text deduce automaticamente la presenza di punti, virgole e punti interrogativi nei tuoi dati audio e li aggiunge alla trascrizione.
Per impostazione predefinita, Speech-to-Text non include segni di punteggiatura nei risultati del riconoscimento vocale. Tuttavia, puoi richiedere a Speech-to-Text di rilevare e inserire automaticamente la punteggiatura nei risultati della trascrizione. Quando attivi la punteggiatura automatica, la funzionalità di Speech-to-Text aggiunge automaticamente la maiuscola alla prima lettera dopo ogni punto e punto interrogativo.
Prima di iniziare
- 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.
Vai a IAM - Seleziona il progetto.
- Fai clic su Concedi l'accesso.
-
Nel campo Nuove entità, inserisci il tuo identificatore utente. In genere si tratta dell'indirizzo email di un Account Google.
- Nell'elenco Seleziona un ruolo, seleziona un ruolo.
- Per concedere altri ruoli, fai clic su Aggiungi un altro ruolo e aggiungi ogni ruolo aggiuntivo.
- Fai clic su Salva.
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.
Vai a IAM - Seleziona il progetto.
- Fai clic su Concedi l'accesso.
-
Nel campo Nuove entità, inserisci il tuo identificatore utente. In genere si tratta dell'indirizzo email di un Account Google.
- Nell'elenco Seleziona un ruolo, seleziona un ruolo.
- Per concedere altri ruoli, fai clic su Aggiungi un altro ruolo e aggiungi ogni ruolo aggiuntivo.
- Fai clic su Salva.
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.
-
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.
- Esercitati a trascrivere file audio corti.
- Scopri come trascrivere l'audio in streaming.
- Scopri come trascrivere file audio lunghi.
- Per ottenere prestazioni, precisione e altri suggerimenti ottimali, consulta la documentazione sulle best practice.
Le librerie client possono utilizzare le credenziali predefinite dell'applicazione per autenticarsi facilmente con le API di Google e inviare richieste a queste API. Con Credenziali predefinite dell'applicazione, puoi testare la tua applicazione localmente e implementarla senza modificare il codice sottostante. Per maggiori informazioni, vedi Autenticarsi per l'utilizzo delle librerie client.
Assicurati inoltre di aver installato la libreria client.
Esecuzione di una richiesta di trascrizione con punteggiatura automatica
Gli esempi di codice riportati di seguito mostrano come ottenere i dettagli della punteggiatura automatica in una richiesta di trascrizione.
Python
Per ulteriori informazioni sulla configurazione delle diverse funzionalità, consulta la documentazione di riferimento di RecognitionFeatures
.
Esegui la pulizia
Per evitare che al tuo account Google Cloud vengano addebitati costi relativi alle risorse utilizzate in questa pagina, segui questi passaggi.
Console
gcloud
Delete a Google Cloud project:
gcloud projects delete PROJECT_ID