5/29/2023 0 Comments Itranslate speeche![]() If set as a string, the account must grant the originating account the Service Account Token Creator IAM role. :param impersonation_chain: Optional service account to impersonate using short-term credentials, or chained list of accounts required to get the access_token of the last account in the list, which will be impersonated in the request. :param gcp_conn_id: Optional, The connection ID used to connect to Google Cloud. If set to None or missing, the default project_id from the Google Cloud connection is used. :param project_id: Optional, Google Cloud Project ID where the Compute Engine Instance exists. :param model: (Optional) The model used to translate the text, such as ``'base'`` or ``'nmt'``. :param source_language: (Optional) The language of the text to be translated. Check the list of available languages here: :param format_: (Optional) One of ``text`` or ``html``, to specify if the input text is plain text or HTML. This is required by the API and defaults to the target language of the current instance. See more: :param target_language: The language to translate results into. See more: :param config: information to the recognizer that specifies how to process the request. :param audio: audio data to be recognized. * ``model``: The model used to translate the text. * ``input``: The corresponding input value. * ``translatedText``: The translation of the text into the target language. * ``detectedSourceLanguage``: The detected language (as an ISO 639-1 language code) of the text. Dictionary typically contains three keys (though not all will be present in all cases). seealso:: For more information on how to use this operator, take a look at the guide: :ref:`howto/operator:CloudTranslateSpeechOperator` See Execute method returns string object with the translation This is a list of dictionaries queried value. Note that it uses the first result from the recognition api response - the one with the highest confidence In order to see other possible results please use :ref:`howto/operator:CloudSpeechToTextRecognizeSpeechOperator` and :ref:`howto/operator:CloudTranslateTextOperator` separately. class CloudTranslateSpeechOperator ( GoogleCloudBaseOperator ): """ Recognizes speech in audio input and translates it. ![]() """This module contains a Google Cloud Translate Speech operator.""" from _future_ import annotations from typing import TYPE_CHECKING, Sequence from _v1.types import RecognitionAudio, RecognitionConfig from _format import MessageToDict from airflow.exceptions import AirflowException from .hooks.speech_to_text import CloudSpeechToTextHook from .anslate import CloudTranslateHook from .operators.cloud_base import GoogleCloudBaseOperator from .links.storage import FileDetailsLink if TYPE_CHECKING : from import Context ![]() See the License for the # specific language governing permissions and limitations # under the License. You may obtain a copy of the License at # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License") you may not use this file except in compliance # with the License. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements.
0 Comments
Leave a Reply. |