AWS Keyphrases Detection

QName: f:aws-keyphrases

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

To learn more about Amazon Comprehend's keyphrase functionality, see: https://docs.aws.amazon.com/comprehend/latest/dg/how-key-phrases.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.

Configuration

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 keyphrase 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_keyphrases 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": "I'm an avid photographer, and I'm primarily found shooting with my DSLR or my instant film camera that I carry around for casual use. While nothing beats my DSLR in power and convenience, there's something magical about my instant film camera. Perhaps it's that you're shooting on actual film, or maybe it's that every shot you take is a unique physical artifact (which is special in today's world of Instagram and Facebook, where photos are a dime a dozen). All I know for sure is that they are incredibly fun to use and peoples' eyes light up when you pull one of these out at a party."
}

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

{
    "title": "I'm an avid photographer, and I'm primarily found shooting with my DSLR or my instant film camera that I carry around for casual use. While nothing beats my DSLR in power and convenience, there's something magical about my instant film camera. Perhaps it's that you're shooting on actual film, or maybe it's that every shot you take is a unique physical artifact (which is special in today's world of Instagram and Facebook, where photos are a dime a dozen). All I know for sure is that they are incredibly fun to use and peoples' eyes light up when you pull one of these out at a party."
    "keyphrases": [
        {
            "text": "an avid photographer",
            "score": 0.997812032699585,
            "beginOffset": 4,
            "endOffset": 24
        },
        {
            "text": "my DSLR",
            "score": 0.9952847361564636,
            "beginOffset": 64,
            "endOffset": 71
        },
        {
            "text": "my instant film camera",
            "score": 0.9871260523796082,
            "beginOffset": 75,
            "endOffset": 97
        },
        {
            "text": "casual use",
            "score": 0.9948915839195251,
            "beginOffset": 122,
            "endOffset": 132
        },
        {
            "text": "my DSLR",
            "score": 0.9984719157218933,
            "beginOffset": 154,
            "endOffset": 161
        },
        {
            "text": "power and convenience",
            "score": 0.9846290349960327,
            "beginOffset": 165,
            "endOffset": 186
        },
        {
            "text": "my instant film camera",
            "score": 0.9917154908180237,
            "beginOffset": 220,
            "endOffset": 242
        },
        {
            "text": "actual film",
            "score": 0.9977796673774719,
            "beginOffset": 281,
            "endOffset": 292
        },
        {
            "text": "every shot",
            "score": 0.8647039532661438,
            "beginOffset": 313,
            "endOffset": 323
        },
        {
            "text": "a unique physical artifact",
            "score": 0.9968715906143188,
            "beginOffset": 336,
            "endOffset": 362
        },
        {
            "text": "today",
            "score": 0.9993119239807129,
            "beginOffset": 384,
            "endOffset": 389
        },
        {
            "text": "world",
            "score": 0.9964506030082703,
            "beginOffset": 392,
            "endOffset": 397
        },
        {
            "text": "Instagram and Facebook",
            "score": 0.9784826040267944,
            "beginOffset": 401,
            "endOffset": 423
        },
        {
            "text": "photos",
            "score": 0.9996316432952881,
            "beginOffset": 431,
            "endOffset": 437
        },
        {
            "text": "a dime",
            "score": 0.9675947427749634,
            "beginOffset": 442,
            "endOffset": 448
        },
        {
            "text": "a dozen",
            "score": 0.9885334372520447,
            "beginOffset": 449,
            "endOffset": 456
        },
        {
            "text": "peoples",
            "score": 0.9504219889640808,
            "beginOffset": 522,
            "endOffset": 529
        },
        {
            "text": "' eyes",
            "score": 0.9364691972732544,
            "beginOffset": 529,
            "endOffset": 535
        },
        {
            "text": "a party",
            "score": 0.9993888139724731,
            "beginOffset": 579,
            "endOffset": 586
        }
    ]
}