:mod:`airflow.contrib.operators.gcp_natural_language_operator` ============================================================== .. py:module:: airflow.contrib.operators.gcp_natural_language_operator Module Contents --------------- .. py:class:: CloudLanguageAnalyzeEntitiesOperator(document, encoding_type=None, retry=None, timeout=None, metadata=None, gcp_conn_id='google_cloud_default', *args, **kwargs) Bases::class:`airflow.models.BaseOperator` Finds named entities in the text along with entity types, salience, mentions for each entity, and other properties. .. seealso:: For more information on how to use this operator, take a look at the guide: :ref:`howto/operator:CloudLanguageAnalyzeEntitiesOperator` :param document: Input document. If a dict is provided, it must be of the same form as the protobuf message Document :type document: dict or google.cloud.language_v1.types.Document :param encoding_type: The encoding type used by the API to calculate offsets. :type encoding_type: google.cloud.language_v1.types.EncodingType :param retry: A retry object used to retry requests. If None is specified, requests will not be retried. :param timeout: The amount of time, in seconds, to wait for the request to complete. Note that if retry is specified, the timeout applies to each individual attempt. :type timeout: float :param metadata: Additional metadata that is provided to the method. :type metadata: seq[tuple[str, str]]] :param gcp_conn_id: The connection ID to use connecting to Google Cloud Platform. :type gcp_conn_id: str .. attribute:: template_fields :annotation: = ['document', 'gcp_conn_id'] .. method:: execute(self, context) .. py:class:: CloudLanguageAnalyzeEntitySentimentOperator(document, encoding_type=None, retry=None, timeout=None, metadata=None, gcp_conn_id='google_cloud_default', *args, **kwargs) Bases::class:`airflow.models.BaseOperator` Finds entities, similar to AnalyzeEntities in the text and analyzes sentiment associated with each entity and its mentions. .. seealso:: For more information on how to use this operator, take a look at the guide: :ref:`howto/operator:CloudLanguageAnalyzeEntitySentimentOperator` :param document: Input document. If a dict is provided, it must be of the same form as the protobuf message Document :type document: dict or google.cloud.language_v1.types.Document :param encoding_type: The encoding type used by the API to calculate offsets. :type encoding_type: google.cloud.language_v1.types.EncodingType :param retry: A retry object used to retry requests. If None is specified, requests will not be retried. :param timeout: The amount of time, in seconds, to wait for the request to complete. Note that if retry is specified, the timeout applies to each individual attempt. :type timeout: float :param metadata: Additional metadata that is provided to the method. :type metadata: seq[tuple[str, str]]] :rtype: google.cloud.language_v1.types.AnalyzeEntitiesResponse :param gcp_conn_id: The connection ID to use connecting to Google Cloud Platform. :type gcp_conn_id: str .. attribute:: template_fields :annotation: = ['document', 'gcp_conn_id'] .. method:: execute(self, context) .. py:class:: CloudLanguageAnalyzeSentimentOperator(document, encoding_type=None, retry=None, timeout=None, metadata=None, gcp_conn_id='google_cloud_default', *args, **kwargs) Bases::class:`airflow.models.BaseOperator` Analyzes the sentiment of the provided text. .. seealso:: For more information on how to use this operator, take a look at the guide: :ref:`howto/operator:CloudLanguageAnalyzeSentimentOperator` :param document: Input document. If a dict is provided, it must be of the same form as the protobuf message Document :type document: dict or google.cloud.language_v1.types.Document :param encoding_type: The encoding type used by the API to calculate offsets. :type encoding_type: google.cloud.language_v1.types.EncodingType :param retry: A retry object used to retry requests. If None is specified, requests will not be retried. :param timeout: The amount of time, in seconds, to wait for the request to complete. Note that if retry is specified, the timeout applies to each individual attempt. :type timeout: float :param metadata: Additional metadata that is provided to the method. :type metadata: sequence[tuple[str, str]]] :rtype: google.cloud.language_v1.types.AnalyzeEntitiesResponse :param gcp_conn_id: The connection ID to use connecting to Google Cloud Platform. :type gcp_conn_id: str .. attribute:: template_fields :annotation: = ['document', 'gcp_conn_id'] .. method:: execute(self, context) .. py:class:: CloudLanguageClassifyTextOperator(document, retry=None, timeout=None, metadata=None, gcp_conn_id='google_cloud_default', *args, **kwargs) Bases::class:`airflow.models.BaseOperator` Classifies a document into categories. .. seealso:: For more information on how to use this operator, take a look at the guide: :ref:`howto/operator:CloudLanguageClassifyTextOperator` :param document: Input document. If a dict is provided, it must be of the same form as the protobuf message Document :type document: dict or google.cloud.language_v1.types.Document :param retry: A retry object used to retry requests. If None is specified, requests will not be retried. :param timeout: The amount of time, in seconds, to wait for the request to complete. Note that if retry is specified, the timeout applies to each individual attempt. :type timeout: float :param metadata: Additional metadata that is provided to the method. :type metadata: sequence[tuple[str, str]]] :param gcp_conn_id: The connection ID to use connecting to Google Cloud Platform. :type gcp_conn_id: str .. attribute:: template_fields :annotation: = ['document', 'gcp_conn_id'] .. method:: execute(self, context)