Cloud Speech-to-Text הוא API שממיר דיבור לטקסט. הוא מקבל נתוני אודיו כקלט ומפיק תמליל טקסט באמצעות טכנולוגיית ה-AI של Google. בדף הזה מוסבר איך להגדיר את Cloud Speech-to-Text API בפרויקט כדי להתחיל לבצע קריאות ל-API.
במסמך הזה מוסבר על הנושאים הבאים:
- הפעלה והשבתה של Cloud Speech-to-Text API בפרויקט ב- Google Cloud
- הפעלת החיוב ב-Cloud Speech-to-Text
- אופציונלי: יצירת Google Cloud קטגוריית אחסון חדשה לאחסון נתוני אודיו של קבצים גדולים
במאמר הזה לא מוסבר איך להתחיל לשלוח ולקבל בקשות באמצעות Cloud Speech-to-Text API. מידע על שילוב של Cloud Speech-to-Text בקוד בפועל מופיע בדף הסקירה הכללית.
לפני שמתחילים
יש שתי דרכים לגשת לשירות: באמצעות API בארכיטקטורת REST או באמצעותGoogle Cloud המסוף.
במדריך הזה מפורטים השלבים שצריך לבצע כדי להתחיל לשלוח בקשות ל-API בארכיטקטורת REST. אם אתם חדשים בתחום התכנות, מומלץ להתחיל עם ההדרכות המפורטות במסוף Google Cloud בפלטפורמה לפני שתתחילו לבצע את השלבים האלה.
הפעלת Cloud Speech-to-Text API בפרויקט ב- Google Cloud
נכנסים למסוףGoogle Cloud .
פותחים את הדף לבחירת פרויקט ובוחרים פרויקט קיים או יוצרים פרויקט חדש. מידע נוסף על יצירת פרויקט זמין במאמר יצירה וניהול של פרויקטים.
אם יוצרים פרויקט חדש, מופיעה בקשה לקשר חשבון לחיוב לפרויקט הזה. אם אתם משתמשים בפרויקט קיים, ודאו שהחיוב מופעל.
מפעילים את Cloud Speech-to-Text API. לוחצים על שדה הטקסט חיפוש מוצרים ומשאבים בחלק העליון של הדף ומקלידים speech. בוחרים באפשרות Cloud Speech-to-Text API מתוך רשימת התוצאות.
כדי להפעיל את Cloud Speech-to-Text API לשימוש בפרויקט, לוחצים על הפעלה. כדי לנסות את Cloud Speech-to-Text בלי לקשר אותו לפרויקט, לוחצים על Try this API.
אופציונלי: (API V1 בלבד) מפעילים רישום ביומן של נתונים. אם תבחרו להפעיל את רישום הנתונים ביומן, תאפשרו ל-Google לתעד את כל נתוני האודיו שתשלחו ל-Cloud Speech-to-Text. הנתונים האלה משמשים לשיפור המודלים של Cloud Speech-to-Text. משתמשים שמסכימים לרישום נתונים נהנים ממחירים נמוכים יותר. מידע נוסף זמין בדפים מחירון ותנאים והגבלות בנושא רישום נתונים.
אופציונלי: יצירת קטגוריה של Cloud Storage
אם אתם רוצים לתמלל אודיו שאורכו יותר מ-60 שניות או שגודל הקובץ שלו גדול מ-10MB, אתם צריכים לאחסן את נתוני האודיו בקטגוריה של Cloud Storage לפני שתוכלו לתמלל אותו באמצעות Cloud Speech-to-Text.
כדי ליצור קטגוריה חדשה של Cloud Storage:
- In the Google Cloud console, go to the Cloud Storage Buckets page.
- Click Create.
- On the Create a bucket page, enter your bucket information. To go to the next
step, click Continue.
- For Name your bucket, enter a unique bucket name. Don't include sensitive information in the bucket name, because the bucket namespace is global and publicly visible.
-
In the Choose where to store your data section, do the following:
- Select a Location type.
- Choose a location where your bucket's data is permanently stored from the Location type drop-down menu.
- If you select the dual-region location type, you can also choose to enable turbo replication by using the relevant checkbox.
- To set up cross-bucket replication, select
Add cross-bucket replication via Storage Transfer Service and
follow these steps:
Set up cross-bucket replication
- In the Bucket menu, select a bucket.
In the Replication settings section, click Configure to configure settings for the replication job.
The Configure cross-bucket replication pane appears.
- To filter objects to replicate by object name prefix, enter a prefix that you want to include or exclude objects from, then click Add a prefix.
- To set a storage class for the replicated objects, select a storage class from the Storage class menu. If you skip this step, the replicated objects will use the destination bucket's storage class by default.
- Click Done.
-
In the Choose how to store your data section, do the following:
- Select a default storage class for the bucket or Autoclass for automatic storage class management of your bucket's data.
- To enable hierarchical namespace, in the Optimize storage for data-intensive workloads section, select Enable hierarchical namespace on this bucket.
- In the Choose how to control access to objects section, select whether or not your bucket enforces public access prevention, and select an access control method for your bucket's objects.
-
In the Choose how to protect object data section, do the
following:
- Select any of the options under Data protection that you
want to set for your bucket.
- To enable soft delete, click the Soft delete policy (For data recovery) checkbox, and specify the number of days you want to retain objects after deletion.
- To set Object Versioning, click the Object versioning (For version control) checkbox, and specify the maximum number of versions per object and the number of days after which the noncurrent versions expire.
- To enable the retention policy on objects and buckets, click the Retention (For compliance) checkbox, and then do the following:
- To enable Object Retention Lock, click the Enable object retention checkbox.
- To enable Bucket Lock, click the Set bucket retention policy checkbox, and choose a unit of time and a length of time for your retention period.
- To choose how your object data will be encrypted, expand the Data encryption section (), and select a Data encryption method.
- Select any of the options under Data protection that you
want to set for your bucket.
- Click Create.
- עוברים אל Google Cloud מרכז הבקרה ולוחצים על Go to APIs overview (מעבר לסקירה כללית של ממשקי API).
- בוחרים באפשרות Cloud Speech-to-Text API.
- לוחצים על השבתת ה-API.
השבתה של Cloud Speech-to-Text API
אם אתם לא צריכים יותר להשתמש ב-Cloud Speech-to-Text API בפרויקט שלכם:
המאמרים הבאים
במאמר הזה מוסבר איך לשלוח בקשת תמלול אל Cloud Speech-to-Text API באמצעות ספריות לקוח, gcloud, שורת הפקודה או ממשק המשתמש של Speech-to-Text.