Amazon Comprehend

2022/03/09 - Amazon Comprehend - 4 new api methods

Changes  Amazon Comprehend now supports extracting the sentiment associated with entities such as brands, products and services from text documents.

DescribeTargetedSentimentDetectionJob (new) Link ¶

Gets the properties associated with a targeted sentiment detection job. Use this operation to get the status of the job.

See also: AWS API Documentation

Request Syntax

client.describe_targeted_sentiment_detection_job(
    JobId='string'
)
type JobId:

string

param JobId:

[REQUIRED]

The identifier that Amazon Comprehend generated for the job. The operation returns this identifier in its response.

rtype:

dict

returns:

Response Syntax

{
    'TargetedSentimentDetectionJobProperties': {
        'JobId': 'string',
        'JobArn': 'string',
        'JobName': 'string',
        'JobStatus': 'SUBMITTED'|'IN_PROGRESS'|'COMPLETED'|'FAILED'|'STOP_REQUESTED'|'STOPPED',
        'Message': 'string',
        'SubmitTime': datetime(2015, 1, 1),
        'EndTime': datetime(2015, 1, 1),
        'InputDataConfig': {
            'S3Uri': 'string',
            'InputFormat': 'ONE_DOC_PER_FILE'|'ONE_DOC_PER_LINE',
            'DocumentReaderConfig': {
                'DocumentReadAction': 'TEXTRACT_DETECT_DOCUMENT_TEXT'|'TEXTRACT_ANALYZE_DOCUMENT',
                'DocumentReadMode': 'SERVICE_DEFAULT'|'FORCE_DOCUMENT_READ_ACTION',
                'FeatureTypes': [
                    'TABLES'|'FORMS',
                ]
            }
        },
        'OutputDataConfig': {
            'S3Uri': 'string',
            'KmsKeyId': 'string'
        },
        'LanguageCode': 'en'|'es'|'fr'|'de'|'it'|'pt'|'ar'|'hi'|'ja'|'ko'|'zh'|'zh-TW',
        'DataAccessRoleArn': 'string',
        'VolumeKmsKeyId': 'string',
        'VpcConfig': {
            'SecurityGroupIds': [
                'string',
            ],
            'Subnets': [
                'string',
            ]
        }
    }
}

Response Structure

  • (dict) --

    • TargetedSentimentDetectionJobProperties (dict) --

      An object that contains the properties associated with a targeted sentiment detection job.

      • JobId (string) --

        The identifier assigned to the targeted sentiment detection job.

      • JobArn (string) --

        The Amazon Resource Name (ARN) of the targeted sentiment detection job. It is a unique, fully qualified identifier for the job. It includes the AWS account, Region, and the job ID. The format of the ARN is as follows:

        arn:<partition>:comprehend:<region>:<account-id>:targeted-sentiment-detection-job/<job-id>

        The following is an example job ARN:

        arn:aws:comprehend:us-west-2:111122223333:targeted-sentiment-detection-job/1234abcd12ab34cd56ef1234567890ab

      • JobName (string) --

        The name that you assigned to the targeted sentiment detection job.

      • JobStatus (string) --

        The current status of the targeted sentiment detection job. If the status is FAILED, the Messages field shows the reason for the failure.

      • Message (string) --

        A description of the status of a job.

      • SubmitTime (datetime) --

        The time that the targeted sentiment detection job was submitted for processing.

      • EndTime (datetime) --

        The time that the targeted sentiment detection job ended.

      • InputDataConfig (dict) --

        The input properties for an inference job.

        • S3Uri (string) --

          The Amazon S3 URI for the input data. The URI must be in same region as the API endpoint that you are calling. The URI can point to a single input file or it can provide the prefix for a collection of data files.

          For example, if you use the URI S3://bucketName/prefix, if the prefix is a single file, Amazon Comprehend uses that file as input. If more than one file begins with the prefix, Amazon Comprehend uses all of them as input.

        • InputFormat (string) --

          Specifies how the text in an input file should be processed:

          • ONE_DOC_PER_FILE - Each file is considered a separate document. Use this option when you are processing large documents, such as newspaper articles or scientific papers.

          • ONE_DOC_PER_LINE - Each line in a file is considered a separate document. Use this option when you are processing many short documents, such as text messages.

        • DocumentReaderConfig (dict) --

          The document reader config field applies only for InputDataConfig of StartEntitiesDetectionJob.

          Use DocumentReaderConfig to provide specifications about how you want your inference documents read. Currently it applies for PDF documents in StartEntitiesDetectionJob custom inference.

          • DocumentReadAction (string) --

            This enum field will start with two values which will apply to PDFs:

            • TEXTRACT_DETECT_DOCUMENT_TEXT - The service calls DetectDocumentText for PDF documents per page.

            • TEXTRACT_ANALYZE_DOCUMENT - The service calls AnalyzeDocument for PDF documents per page.

          • DocumentReadMode (string) --

            This enum field provides two values:

            • SERVICE_DEFAULT - use service defaults for Document reading. For Digital PDF it would mean using an internal parser instead of Textract APIs

            • FORCE_DOCUMENT_READ_ACTION - Always use specified action for DocumentReadAction, including Digital PDF.

          • FeatureTypes (list) --

            Specifies how the text in an input file should be processed:

            • (string) --

              A list of the types of analyses to perform. This field specifies what feature types need to be extracted from the document where entity recognition is expected.

              • TABLES - Add TABLES to the list to return information about the tables that are detected in the input document.

              • FORMS - Add FORMS to return detected form data.

      • OutputDataConfig (dict) --

        Provides configuration parameters for the output of inference jobs.

        • S3Uri (string) --

          When you use the OutputDataConfig object with asynchronous operations, you specify the Amazon S3 location where you want to write the output data. The URI must be in the same region as the API endpoint that you are calling. The location is used as the prefix for the actual location of the output file.

          When the topic detection job is finished, the service creates an output file in a directory specific to the job. The S3Uri field contains the location of the output file, called output.tar.gz. It is a compressed archive that contains the ouput of the operation.

          For a PII entity detection job, the output file is plain text, not a compressed archive. The output file name is the same as the input file, with .out appended at the end.

        • KmsKeyId (string) --

          ID for the AWS Key Management Service (KMS) key that Amazon Comprehend uses to encrypt the output results from an analysis job. The KmsKeyId can be one of the following formats:

          • KMS Key ID: "1234abcd-12ab-34cd-56ef-1234567890ab"

          • Amazon Resource Name (ARN) of a KMS Key: "arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab"

          • KMS Key Alias: "alias/ExampleAlias"

          • ARN of a KMS Key Alias: "arn:aws:kms:us-west-2:111122223333:alias/ExampleAlias"

      • LanguageCode (string) --

        The language code of the input documents.

      • DataAccessRoleArn (string) --

        The Amazon Resource Name (ARN) that gives Amazon Comprehend read access to your input data.

      • VolumeKmsKeyId (string) --

        ID for the AWS Key Management Service (KMS) key that Amazon Comprehend uses to encrypt data on the storage volume attached to the ML compute instance(s) that process the targeted sentiment detection job. The VolumeKmsKeyId can be either of the following formats:

        • KMS Key ID: "1234abcd-12ab-34cd-56ef-1234567890ab"

        • Amazon Resource Name (ARN) of a KMS Key: "arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab"

      • VpcConfig (dict) --

        Configuration parameters for an optional private Virtual Private Cloud (VPC) containing the resources you are using for the job. For more information, see Amazon VPC.

        • SecurityGroupIds (list) --

          The ID number for a security group on an instance of your private VPC. Security groups on your VPC function serve as a virtual firewall to control inbound and outbound traffic and provides security for the resources that you’ll be accessing on the VPC. This ID number is preceded by "sg-", for instance: "sg-03b388029b0a285ea". For more information, see Security Groups for your VPC.

          • (string) --

        • Subnets (list) --

          The ID for each subnet being used in your private VPC. This subnet is a subset of the a range of IPv4 addresses used by the VPC and is specific to a given availability zone in the VPC’s region. This ID number is preceded by "subnet-", for instance: "subnet-04ccf456919e69055". For more information, see VPCs and Subnets.

          • (string) --

StopTargetedSentimentDetectionJob (new) Link ¶

Stops a targeted sentiment detection job in progress.

If the job state is IN_PROGRESS the job is marked for termination and put into the STOP_REQUESTED state. If the job completes before it can be stopped, it is put into the COMPLETED state; otherwise the job is be stopped and put into the STOPPED state.

If the job is in the COMPLETED or FAILED state when you call the StopDominantLanguageDetectionJob operation, the operation returns a 400 Internal Request Exception.

When a job is stopped, any documents already processed are written to the output location.

See also: AWS API Documentation

Request Syntax

client.stop_targeted_sentiment_detection_job(
    JobId='string'
)
type JobId:

string

param JobId:

[REQUIRED]

The identifier of the targeted sentiment detection job to stop.

rtype:

dict

returns:

Response Syntax

{
    'JobId': 'string',
    'JobStatus': 'SUBMITTED'|'IN_PROGRESS'|'COMPLETED'|'FAILED'|'STOP_REQUESTED'|'STOPPED'
}

Response Structure

  • (dict) --

    • JobId (string) --

      The identifier of the targeted sentiment detection job to stop.

    • JobStatus (string) --

      Either STOP_REQUESTED if the job is currently running, or STOPPED if the job was previously stopped with the StopSentimentDetectionJob operation.

ListTargetedSentimentDetectionJobs (new) Link ¶

Gets a list of targeted sentiment detection jobs that you have submitted.

See also: AWS API Documentation

Request Syntax

client.list_targeted_sentiment_detection_jobs(
    Filter={
        'JobName': 'string',
        'JobStatus': 'SUBMITTED'|'IN_PROGRESS'|'COMPLETED'|'FAILED'|'STOP_REQUESTED'|'STOPPED',
        'SubmitTimeBefore': datetime(2015, 1, 1),
        'SubmitTimeAfter': datetime(2015, 1, 1)
    },
    NextToken='string',
    MaxResults=123
)
type Filter:

dict

param Filter:

Filters the jobs that are returned. You can filter jobs on their name, status, or the date and time that they were submitted. You can only set one filter at a time.

  • JobName (string) --

    Filters on the name of the job.

  • JobStatus (string) --

    Filters the list of jobs based on job status. Returns only jobs with the specified status.

  • SubmitTimeBefore (datetime) --

    Filters the list of jobs based on the time that the job was submitted for processing. Returns only jobs submitted before the specified time. Jobs are returned in ascending order, oldest to newest.

  • SubmitTimeAfter (datetime) --

    Filters the list of jobs based on the time that the job was submitted for processing. Returns only jobs submitted after the specified time. Jobs are returned in descending order, newest to oldest.

type NextToken:

string

param NextToken:

Identifies the next page of results to return.

type MaxResults:

integer

param MaxResults:

The maximum number of results to return in each page. The default is 100.

rtype:

dict

returns:

Response Syntax

{
    'TargetedSentimentDetectionJobPropertiesList': [
        {
            'JobId': 'string',
            'JobArn': 'string',
            'JobName': 'string',
            'JobStatus': 'SUBMITTED'|'IN_PROGRESS'|'COMPLETED'|'FAILED'|'STOP_REQUESTED'|'STOPPED',
            'Message': 'string',
            'SubmitTime': datetime(2015, 1, 1),
            'EndTime': datetime(2015, 1, 1),
            'InputDataConfig': {
                'S3Uri': 'string',
                'InputFormat': 'ONE_DOC_PER_FILE'|'ONE_DOC_PER_LINE',
                'DocumentReaderConfig': {
                    'DocumentReadAction': 'TEXTRACT_DETECT_DOCUMENT_TEXT'|'TEXTRACT_ANALYZE_DOCUMENT',
                    'DocumentReadMode': 'SERVICE_DEFAULT'|'FORCE_DOCUMENT_READ_ACTION',
                    'FeatureTypes': [
                        'TABLES'|'FORMS',
                    ]
                }
            },
            'OutputDataConfig': {
                'S3Uri': 'string',
                'KmsKeyId': 'string'
            },
            'LanguageCode': 'en'|'es'|'fr'|'de'|'it'|'pt'|'ar'|'hi'|'ja'|'ko'|'zh'|'zh-TW',
            'DataAccessRoleArn': 'string',
            'VolumeKmsKeyId': 'string',
            'VpcConfig': {
                'SecurityGroupIds': [
                    'string',
                ],
                'Subnets': [
                    'string',
                ]
            }
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    • TargetedSentimentDetectionJobPropertiesList (list) --

      A list containing the properties of each job that is returned.

      • (dict) --

        Provides information about a targeted sentiment detection job.

        • JobId (string) --

          The identifier assigned to the targeted sentiment detection job.

        • JobArn (string) --

          The Amazon Resource Name (ARN) of the targeted sentiment detection job. It is a unique, fully qualified identifier for the job. It includes the AWS account, Region, and the job ID. The format of the ARN is as follows:

          arn:<partition>:comprehend:<region>:<account-id>:targeted-sentiment-detection-job/<job-id>

          The following is an example job ARN:

          arn:aws:comprehend:us-west-2:111122223333:targeted-sentiment-detection-job/1234abcd12ab34cd56ef1234567890ab

        • JobName (string) --

          The name that you assigned to the targeted sentiment detection job.

        • JobStatus (string) --

          The current status of the targeted sentiment detection job. If the status is FAILED, the Messages field shows the reason for the failure.

        • Message (string) --

          A description of the status of a job.

        • SubmitTime (datetime) --

          The time that the targeted sentiment detection job was submitted for processing.

        • EndTime (datetime) --

          The time that the targeted sentiment detection job ended.

        • InputDataConfig (dict) --

          The input properties for an inference job.

          • S3Uri (string) --

            The Amazon S3 URI for the input data. The URI must be in same region as the API endpoint that you are calling. The URI can point to a single input file or it can provide the prefix for a collection of data files.

            For example, if you use the URI S3://bucketName/prefix, if the prefix is a single file, Amazon Comprehend uses that file as input. If more than one file begins with the prefix, Amazon Comprehend uses all of them as input.

          • InputFormat (string) --

            Specifies how the text in an input file should be processed:

            • ONE_DOC_PER_FILE - Each file is considered a separate document. Use this option when you are processing large documents, such as newspaper articles or scientific papers.

            • ONE_DOC_PER_LINE - Each line in a file is considered a separate document. Use this option when you are processing many short documents, such as text messages.

          • DocumentReaderConfig (dict) --

            The document reader config field applies only for InputDataConfig of StartEntitiesDetectionJob.

            Use DocumentReaderConfig to provide specifications about how you want your inference documents read. Currently it applies for PDF documents in StartEntitiesDetectionJob custom inference.

            • DocumentReadAction (string) --

              This enum field will start with two values which will apply to PDFs:

              • TEXTRACT_DETECT_DOCUMENT_TEXT - The service calls DetectDocumentText for PDF documents per page.

              • TEXTRACT_ANALYZE_DOCUMENT - The service calls AnalyzeDocument for PDF documents per page.

            • DocumentReadMode (string) --

              This enum field provides two values:

              • SERVICE_DEFAULT - use service defaults for Document reading. For Digital PDF it would mean using an internal parser instead of Textract APIs

              • FORCE_DOCUMENT_READ_ACTION - Always use specified action for DocumentReadAction, including Digital PDF.

            • FeatureTypes (list) --

              Specifies how the text in an input file should be processed:

              • (string) --

                A list of the types of analyses to perform. This field specifies what feature types need to be extracted from the document where entity recognition is expected.

                • TABLES - Add TABLES to the list to return information about the tables that are detected in the input document.

                • FORMS - Add FORMS to return detected form data.

        • OutputDataConfig (dict) --

          Provides configuration parameters for the output of inference jobs.

          • S3Uri (string) --

            When you use the OutputDataConfig object with asynchronous operations, you specify the Amazon S3 location where you want to write the output data. The URI must be in the same region as the API endpoint that you are calling. The location is used as the prefix for the actual location of the output file.

            When the topic detection job is finished, the service creates an output file in a directory specific to the job. The S3Uri field contains the location of the output file, called output.tar.gz. It is a compressed archive that contains the ouput of the operation.

            For a PII entity detection job, the output file is plain text, not a compressed archive. The output file name is the same as the input file, with .out appended at the end.

          • KmsKeyId (string) --

            ID for the AWS Key Management Service (KMS) key that Amazon Comprehend uses to encrypt the output results from an analysis job. The KmsKeyId can be one of the following formats:

            • KMS Key ID: "1234abcd-12ab-34cd-56ef-1234567890ab"

            • Amazon Resource Name (ARN) of a KMS Key: "arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab"

            • KMS Key Alias: "alias/ExampleAlias"

            • ARN of a KMS Key Alias: "arn:aws:kms:us-west-2:111122223333:alias/ExampleAlias"

        • LanguageCode (string) --

          The language code of the input documents.

        • DataAccessRoleArn (string) --

          The Amazon Resource Name (ARN) that gives Amazon Comprehend read access to your input data.

        • VolumeKmsKeyId (string) --

          ID for the AWS Key Management Service (KMS) key that Amazon Comprehend uses to encrypt data on the storage volume attached to the ML compute instance(s) that process the targeted sentiment detection job. The VolumeKmsKeyId can be either of the following formats:

          • KMS Key ID: "1234abcd-12ab-34cd-56ef-1234567890ab"

          • Amazon Resource Name (ARN) of a KMS Key: "arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab"

        • VpcConfig (dict) --

          Configuration parameters for an optional private Virtual Private Cloud (VPC) containing the resources you are using for the job. For more information, see Amazon VPC.

          • SecurityGroupIds (list) --

            The ID number for a security group on an instance of your private VPC. Security groups on your VPC function serve as a virtual firewall to control inbound and outbound traffic and provides security for the resources that you’ll be accessing on the VPC. This ID number is preceded by "sg-", for instance: "sg-03b388029b0a285ea". For more information, see Security Groups for your VPC.

            • (string) --

          • Subnets (list) --

            The ID for each subnet being used in your private VPC. This subnet is a subset of the a range of IPv4 addresses used by the VPC and is specific to a given availability zone in the VPC’s region. This ID number is preceded by "subnet-", for instance: "subnet-04ccf456919e69055". For more information, see VPCs and Subnets.

            • (string) --

    • NextToken (string) --

      Identifies the next page of results to return.

StartTargetedSentimentDetectionJob (new) Link ¶

Starts an asynchronous targeted sentiment detection job for a collection of documents. Use the operation to track the status of a job.

See also: AWS API Documentation

Request Syntax

client.start_targeted_sentiment_detection_job(
    InputDataConfig={
        'S3Uri': 'string',
        'InputFormat': 'ONE_DOC_PER_FILE'|'ONE_DOC_PER_LINE',
        'DocumentReaderConfig': {
            'DocumentReadAction': 'TEXTRACT_DETECT_DOCUMENT_TEXT'|'TEXTRACT_ANALYZE_DOCUMENT',
            'DocumentReadMode': 'SERVICE_DEFAULT'|'FORCE_DOCUMENT_READ_ACTION',
            'FeatureTypes': [
                'TABLES'|'FORMS',
            ]
        }
    },
    OutputDataConfig={
        'S3Uri': 'string',
        'KmsKeyId': 'string'
    },
    DataAccessRoleArn='string',
    JobName='string',
    LanguageCode='en'|'es'|'fr'|'de'|'it'|'pt'|'ar'|'hi'|'ja'|'ko'|'zh'|'zh-TW',
    ClientRequestToken='string',
    VolumeKmsKeyId='string',
    VpcConfig={
        'SecurityGroupIds': [
            'string',
        ],
        'Subnets': [
            'string',
        ]
    },
    Tags=[
        {
            'Key': 'string',
            'Value': 'string'
        },
    ]
)
type InputDataConfig:

dict

param InputDataConfig:

[REQUIRED]

The input properties for an inference job.

  • S3Uri (string) -- [REQUIRED]

    The Amazon S3 URI for the input data. The URI must be in same region as the API endpoint that you are calling. The URI can point to a single input file or it can provide the prefix for a collection of data files.

    For example, if you use the URI S3://bucketName/prefix, if the prefix is a single file, Amazon Comprehend uses that file as input. If more than one file begins with the prefix, Amazon Comprehend uses all of them as input.

  • InputFormat (string) --

    Specifies how the text in an input file should be processed:

    • ONE_DOC_PER_FILE - Each file is considered a separate document. Use this option when you are processing large documents, such as newspaper articles or scientific papers.

    • ONE_DOC_PER_LINE - Each line in a file is considered a separate document. Use this option when you are processing many short documents, such as text messages.

  • DocumentReaderConfig (dict) --

    The document reader config field applies only for InputDataConfig of StartEntitiesDetectionJob.

    Use DocumentReaderConfig to provide specifications about how you want your inference documents read. Currently it applies for PDF documents in StartEntitiesDetectionJob custom inference.

    • DocumentReadAction (string) -- [REQUIRED]

      This enum field will start with two values which will apply to PDFs:

      • TEXTRACT_DETECT_DOCUMENT_TEXT - The service calls DetectDocumentText for PDF documents per page.

      • TEXTRACT_ANALYZE_DOCUMENT - The service calls AnalyzeDocument for PDF documents per page.

    • DocumentReadMode (string) --

      This enum field provides two values:

      • SERVICE_DEFAULT - use service defaults for Document reading. For Digital PDF it would mean using an internal parser instead of Textract APIs

      • FORCE_DOCUMENT_READ_ACTION - Always use specified action for DocumentReadAction, including Digital PDF.

    • FeatureTypes (list) --

      Specifies how the text in an input file should be processed:

      • (string) --

        A list of the types of analyses to perform. This field specifies what feature types need to be extracted from the document where entity recognition is expected.

        • TABLES - Add TABLES to the list to return information about the tables that are detected in the input document.

        • FORMS - Add FORMS to return detected form data.

type OutputDataConfig:

dict

param OutputDataConfig:

[REQUIRED]

Specifies where to send the output files.

  • S3Uri (string) -- [REQUIRED]

    When you use the OutputDataConfig object with asynchronous operations, you specify the Amazon S3 location where you want to write the output data. The URI must be in the same region as the API endpoint that you are calling. The location is used as the prefix for the actual location of the output file.

    When the topic detection job is finished, the service creates an output file in a directory specific to the job. The S3Uri field contains the location of the output file, called output.tar.gz. It is a compressed archive that contains the ouput of the operation.

    For a PII entity detection job, the output file is plain text, not a compressed archive. The output file name is the same as the input file, with .out appended at the end.

  • KmsKeyId (string) --

    ID for the AWS Key Management Service (KMS) key that Amazon Comprehend uses to encrypt the output results from an analysis job. The KmsKeyId can be one of the following formats:

    • KMS Key ID: "1234abcd-12ab-34cd-56ef-1234567890ab"

    • Amazon Resource Name (ARN) of a KMS Key: "arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab"

    • KMS Key Alias: "alias/ExampleAlias"

    • ARN of a KMS Key Alias: "arn:aws:kms:us-west-2:111122223333:alias/ExampleAlias"

type DataAccessRoleArn:

string

param DataAccessRoleArn:

[REQUIRED]

The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that grants Amazon Comprehend read access to your input data. For more information, see Role-based permissions.

type JobName:

string

param JobName:

The identifier of the job.

type LanguageCode:

string

param LanguageCode:

[REQUIRED]

The language of the input documents. You can specify any of the primary languages supported by Amazon Comprehend. All documents must be in the same language.

type ClientRequestToken:

string

param ClientRequestToken:

A unique identifier for the request. If you don't set the client request token, Amazon Comprehend generates one.

This field is autopopulated if not provided.

type VolumeKmsKeyId:

string

param VolumeKmsKeyId:

ID for the KMS key that Amazon Comprehend uses to encrypt data on the storage volume attached to the ML compute instance(s) that process the analysis job. The VolumeKmsKeyId can be either of the following formats:

  • KMS Key ID: "1234abcd-12ab-34cd-56ef-1234567890ab"

  • Amazon Resource Name (ARN) of a KMS Key: "arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab"

type VpcConfig:

dict

param VpcConfig:

Configuration parameters for an optional private Virtual Private Cloud (VPC) containing the resources you are using for the job. For more information, see Amazon VPC.

  • SecurityGroupIds (list) -- [REQUIRED]

    The ID number for a security group on an instance of your private VPC. Security groups on your VPC function serve as a virtual firewall to control inbound and outbound traffic and provides security for the resources that you’ll be accessing on the VPC. This ID number is preceded by "sg-", for instance: "sg-03b388029b0a285ea". For more information, see Security Groups for your VPC.

    • (string) --

  • Subnets (list) -- [REQUIRED]

    The ID for each subnet being used in your private VPC. This subnet is a subset of the a range of IPv4 addresses used by the VPC and is specific to a given availability zone in the VPC’s region. This ID number is preceded by "subnet-", for instance: "subnet-04ccf456919e69055". For more information, see VPCs and Subnets.

    • (string) --

type Tags:

list

param Tags:

Tags to be associated with the targeted sentiment detection job. A tag is a key-value pair that adds metadata to a resource used by Amazon Comprehend. For example, a tag with "Sales" as the key might be added to a resource to indicate its use by the sales department.

  • (dict) --

    A key-value pair that adds as a metadata to a resource used by Amazon Comprehend. For example, a tag with the key-value pair ‘Department’:’Sales’ might be added to a resource to indicate its use by a particular department.

    • Key (string) -- [REQUIRED]

      The initial part of a key-value pair that forms a tag associated with a given resource. For instance, if you want to show which resources are used by which departments, you might use “Department” as the key portion of the pair, with multiple possible values such as “sales,” “legal,” and “administration.”

    • Value (string) --

      The second part of a key-value pair that forms a tag associated with a given resource. For instance, if you want to show which resources are used by which departments, you might use “Department” as the initial (key) portion of the pair, with a value of “sales” to indicate the sales department.

rtype:

dict

returns:

Response Syntax

{
    'JobId': 'string',
    'JobArn': 'string',
    'JobStatus': 'SUBMITTED'|'IN_PROGRESS'|'COMPLETED'|'FAILED'|'STOP_REQUESTED'|'STOPPED'
}

Response Structure

  • (dict) --

    • JobId (string) --

      The identifier generated for the job. To get the status of a job, use this identifier with the operation.

    • JobArn (string) --

      The Amazon Resource Name (ARN) of the targeted sentiment detection job. It is a unique, fully qualified identifier for the job. It includes the AWS account, Region, and the job ID. The format of the ARN is as follows:

      arn:<partition>:comprehend:<region>:<account-id>:targeted-sentiment-detection-job/<job-id>

      The following is an example job ARN:

      arn:aws:comprehend:us-west-2:111122223333:targeted-sentiment-detection-job/1234abcd12ab34cd56ef1234567890ab

    • JobStatus (string) --

      The status of the job.

      • SUBMITTED - The job has been received and is queued for processing.

      • IN_PROGRESS - Amazon Comprehend is processing the job.

      • COMPLETED - The job was successfully completed and the output is available.

      • FAILED - The job did not complete. To get details, use the operation.