---
description: Part of the AWS Processor package
---

# DetectSyntax Processor

This processor will take an input string and returns the different parts of speech present in the input text.

## Properties

{% hint style="info" %}
All of our Comprehend processors also include these [common properties](..#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.Syntax` attribute, which will be created if it isn't present.

{% tabs %}
{% tab title="Output Format" %}
| Field Name | Data Type      | Description                            |
| ---------- | -------------- | -------------------------------------- |
| tokens     | array of Token | The list of tokens detected by the API |
{% endtab %}

{% tab title="Relevant Data Structures" %}
#### `Token`

| 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": "...",
	"output": {
		"tokens": [
			{
				"score": 0.8516682,
				"beginOffset": 0,
				"endOffset": 4,
				"id": 1,
				"partOfSpeech": "NOUN",
				"text": "HOME"
			},
			{
				"score": 0.916234,
				"beginOffset": 5,
				"endOffset": 12,
				"id": 2,
				"partOfSpeech": "NOUN",
				"text": "THEATER"
			},
			// ... plus potentially many more entries!
		]
	}
}
```
{% endtab %}
{% endtabs %}
