AWS Entities Detection

QName: f:aws-entities

Allows for the text of a node to be automatically analyzed by Amazon Comprehend, and produces a list of entities in the text as well as entity types, corresponding confidence scores, and character offsets.

To learn more about Amazon Comprehend's entities functionality, see: https://docs.aws.amazon.com/comprehend/latest/dg/how-entities.html

To use this feature, you will need to have an AWS account along with IAM user credential that provide full access rights to the Amazon Comprehend service.

Property Type Required Default Read-Only Description
serviceDescriptorId text false The ID or Key of the service descriptor to use.
property text true The property where entity results will be written to.

Create a Service Descriptor

To use this feature, you will first need to declare a Service within Cloud CMS. Go to the Manage Platform > Services page and then click Create a New Service.

Given the service any Title and unique Key that you'd like.

The type should be aws_entities and the configuration should look like this:

{
    "accessKey": "",
    "secretKey": "",
    "region": ""
}

Save your service. That's all there is to it.

Example

Suppose we have a piece of content like this:

{
    "title": "Bob ordered two sandwiches and three ice cream cones today from a store in Seattle"
}

We might add the f:aws-entities feature and tell it to populate the results field with its findings. When we save the content, AWS Comprehend's Entities Detection service runs in the background and our node ends up looking like this:

{
    "title": "Bob ordered two sandwiches and three ice cream cones today from a store in Seattle",
    "results": [{
        "text":"Bob",
        "score":0.9626241326332092,
        "beginOffset":0,
        "endOffset":3,
        "type":"PERSON"
    },{
        "text":"two sandwiches",
        "score":0.8694138526916504,
        "beginOffset":12,
        "endOffset":26,
        "type":"QUANTITY"
    },{
        "text":"three ice cream cones",
        "score":0.8618291616439819,
        "beginOffset":31,
        "endOffset":52,
        "type":"QUANTITY"
    },{
        "text":"today",
        "score":0.9653785824775696,
        "beginOffset":53,
        "endOffset":58,
        "type":"DATE"
    },{
        "text":"Seattle",
        "score":0.9990045428276062,
        "beginOffset":75,
        "endOffset":82,
        "type":"LOCATION"
    }]
}