# DetectKeyPhrases Processor

This processor will take an input string and return key phrases found in the text.

## Properties

{% hint style="info" %}
All of our Comprehend processors also include these [common properties](https://calculatedsystems.gitbook.io/cloud-nifi-processors/amazon-web-services/comprehend-api/..#common-properties).
{% endhint %}

This processor does not have any unique properties outside of the common ones.

## Data Output

If the *Destination* property is set to `flowfile-attribute`, then the output of this processor will be routed to the FlowFile's `nlp.KeyPhrases` attribute, which will be created if it isn't present.

{% tabs %}
{% tab title="Output Format" %}

| Field Name   | Data Type          | Description                                 |
| ------------ | ------------------ | ------------------------------------------- |
| keyPhrases   | array of KeyPhrase | The list of key phrases detected by the API |
| {% endtab %} |                    |                                             |

{% tab title="Relevant Data Structures" %}

#### `KeyPhrase`

| Field Name   | Data Type | Description                                                                                            |
| ------------ | --------- | ------------------------------------------------------------------------------------------------------ |
| text         | string    | The raw text of the entity                                                                             |
| score        | float     | How confident the API is in its response                                                               |
| beginOffset  | int       | The number of characters this entity is offset from the beginning of the input string                  |
| endOffset    | int       | The number of characters this entity's last character is offset from the beginning of the input string |
| {% endtab %} |           |                                                                                                        |

{% tab title="Example Output" %}

```javascript
{
	"raw-input": "...": {
		"keyPhrases": [
			{
				"score": 0.9991118,
				"beginOffset": 0,
				"endOffset": 74,
				"text": "Computers are machines"
			},
			{
				"score": 0.988914,
				"beginOffset": 100,
				"endOffset": 121,
				"text": "that can perform calculations much faster than humans"
			},
			// ... plus potentially many more entries!
		]
	}
}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://calculatedsystems.gitbook.io/cloud-nifi-processors/amazon-web-services/comprehend-api/detectkeyphrases-processor.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
