# AnalyzeEntities Processor

{% hint style="info" %}
This processor does not handle analyzing sentiment of entities. This can be accomplished with the [AnalyzeEntitiesWithSentiment](https://calculatedsystems.gitbook.io/cloud-nifi-processors/google-cloud-platform/natural-language-api/analyzeentitieswithsentiment-processor) processor.
{% endhint %}

This processor takes in an input string and returns textual references to real world items (such as names, places, etcetera).

## Properties

{% hint style="info" %}
All of our Natural Language processors also include these [common properties](https://calculatedsystems.gitbook.io/cloud-nifi-processors/google-cloud-platform/natural-language-api/..#common-properties).
{% endhint %}

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

## Data Output

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

| Field Name   | Data Type       | Description                                               |
| ------------ | --------------- | --------------------------------------------------------- |
| entities     | array of Entity | The list of all entities found                            |
| language     | string          | The language code of the language the input message is in |
| {% endtab %} |                 |                                                           |

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

#### `Entity`

| Field Name | Data Type                                                                                                                                 | Description                                                                                                                                                     |
| ---------- | ----------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| mentions   | array of Mention                                                                                                                          | The words/tokens that relate to this entity                                                                                                                     |
| type       | string ([EntityType](https://calculatedsystems.gitbook.io/cloud-nifi-processors/google-cloud-platform/natural-language-api/entity-types)) | This entity's classifier type                                                                                                                                   |
| metadata   | any                                                                                                                                       | [*See section on the metadata field*](https://calculatedsystems.gitbook.io/cloud-nifi-processors/google-cloud-platform/natural-language-api/the-metadata-field) |

#### `Mention`

| Field Name   | Data Type                                                                                                                                 | Description                                                                                                 |
| ------------ | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- |
| text         | string                                                                                                                                    | The raw text of the mention                                                                                 |
| beginOffset  | int                                                                                                                                       | The numer of characters from the beginning of the input string to the beginning of the text of this mention |
| type         | string ([EntityType](https://calculatedsystems.gitbook.io/cloud-nifi-processors/google-cloud-platform/natural-language-api/entity-types)) | The type of mention this is. They follow the same names and descriptions as EntityTypes.                    |
| {% endtab %} |                                                                                                                                           |                                                                                                             |

{% tab title="Example Output" %}

```javascript
{
   "output":{
      "entities":[
         {
            "metadata":{
               "wikipedia_url":"https:\/\/en.wikipedia.org\/wiki\/James_Adams_(entrepreneur)",
               "mid":"\/m\/0136zb57"
            },
            "mentions":[
               {
                  "text":"James Adams",
                  "type":"PROPER",
                  "beginOffset":-1
               },
               {
                  "text":"developer",
                  "type":"COMMON",
                  "beginOffset":-1
               }
            ],
            "type":"PERSON"
         },
         {
            "metadata":{

            },
            "mentions":[
               {
                  "text":"scene",
                  "type":"COMMON",
                  "beginOffset":-1
               }
            ],
            "type":"LOCATION"
         },
         {
            "metadata":{

            },
            "mentions":[
               {
                  "text":"attitude",
                  "type":"COMMON",
                  "beginOffset":-1
               }
            ],
            "type":"OTHER"
         },
         {
            "metadata":{

            },
            "mentions":[
               {
                  "text":"work ethic",
                  "type":"COMMON",
                  "beginOffset":-1
               }
            ],
            "type":"OTHER"
         },
         {
            "metadata":{

            },
            "mentions":[
               {
                  "text":"company",
                  "type":"COMMON",
                  "beginOffset":-1
               }
            ],
            "type":"ORGANIZATION"
         },
         {
            "metadata":{

            },
            "mentions":[
               {
                  "text":"character",
                  "type":"COMMON",
                  "beginOffset":-1
               }
            ],
            "type":"PERSON"
         },
         {
            "metadata":{
               "value":"10"
            },
            "mentions":[
               {
                  "text":"ten",
                  "type":"TYPE_UNKNOWN",
                  "beginOffset":-1
               }
            ],
            "type":"NUMBER"
         }
      ],
      "language":"en"
   },
   "raw-input":"James Adams is a fantastic developer who has been on the scene for over ten years. His excellent attitude and steady work ethic contribute to his character. May he stay with our company for many years to come."
}
```

{% endtab %}
{% endtabs %}

###
