- AWS Code Sample demonstrates how to determine the named entities in a document.

# Copyright 2010-2019, Inc. or its affiliates. All Rights Reserved. # # This file is licensed under the Apache License, Version 2.0 (the "License"). # You may not use this file except in compliance with the License. A copy of the # License is located at # # # # This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS # OF ANY KIND, either express or implied. See the License for the specific # language governing permissions and limitations under the License. import boto3 import json comprehend = boto3.client(service_name='comprehend', region_name='region') text = 'It is raining today in Seattle' print('Calling DetectEntities') print(json.dumps(comprehend.detect_entities(Text=text, LanguageCode='en'), sort_keys=True, indent=4)) print('End of DetectEntities\n')

Sample Details

Service: comprehend

Last tested: 2019-01-31

Author: AWS

Type: full-example