Entity

Represents a phrase in the text that is a known entity, such as a person, an organization, or location. The API associates information, such as salience and mentions, with entities.

JSON representation
{
  "name": string,
  "type": enum(Type),
  "metadata": {
    string: string,
    ...
  },
  "salience": number,
  "mentions": [
    {
      object(EntityMention)
    }
  ],
  "sentiment": {
    object(Sentiment)
  },
}
Fields
name

string

The representative name for the entity.

type

enum(Type)

The entity type.

metadata

map (key: string, value: string)

Metadata associated with the entity.

Currently, Wikipedia URLs and Knowledge Graph MIDs are provided, if available. The associated keys are "wikipedia_url" and "mid", respectively.

An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }.

salience

number

The salience score associated with the entity in the [0, 1.0] range.

The salience score for an entity provides information about the importance or centrality of that entity to the entire document text. Scores closer to 0 are less salient, while scores closer to 1.0 are highly salient.

mentions[]

object(EntityMention)

The mentions of this entity in the input document. The API currently supports proper noun mentions.

sentiment

object(Sentiment)

For calls to [documents.analyzeEntitySentiment][] or if AnnotateTextRequest.Features.extract_entity_sentiment is set to true, this field will contain the aggregate sentiment expressed for this entity in the provided document.

Type

The type of the entity.

Enums
UNKNOWN Unknown
PERSON Person
LOCATION Location
ORGANIZATION Organization
EVENT Event
WORK_OF_ART Work of art
CONSUMER_GOOD Consumer goods
OTHER Other types

EntityMention

Represents a mention for an entity in the text. Currently, proper noun mentions are supported.

JSON representation
{
  "text": {
    object(TextSpan)
  },
  "type": enum(Type),
  "sentiment": {
    object(Sentiment)
  },
}
Fields
text

object(TextSpan)

The mention text.

type

enum(Type)

The type of the entity mention.

sentiment

object(Sentiment)

For calls to [documents.analyzeEntitySentiment][] or if AnnotateTextRequest.Features.extract_entity_sentiment is set to true, this field will contain the sentiment expressed for this mention of the entity in the provided document.

Type

The supported types of mentions.

Enums
TYPE_UNKNOWN Unknown
PROPER Proper name
COMMON Common noun (or noun compound)

Send feedback about...

Google Cloud Natural Language API