class Entity extends Message

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.

Protobuf type Google\Cloud\Language\V1beta2\Entity

Methods

__construct()

No description

string
getName()

The representative name for the entity.

setName(string $var)

The representative name for the entity.

int
getType()

The entity type.

setType(int $var)

The entity type.

RepeatedField
getMetadata()

Metadata associated with the entity.

setMetadata(array|RepeatedField $var)

Metadata associated with the entity.

float
getSalience()

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

setSalience(float $var)

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

RepeatedField
getMentions()

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

setMentions(array|RepeatedField $var)

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

getSentiment()

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

setSentiment(Sentiment $var)

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

Details

at line 67
__construct()

at line 78
string getName()

The representative name for the entity.

Generated from protobuf field string name = 1;

Return Value

string

at line 89
setName(string $var)

The representative name for the entity.

Generated from protobuf field string name = 1;

Parameters

string $var

at line 101
int getType()

The entity type.

Generated from protobuf field .google.cloud.language.v1beta2.Entity.Type type = 2;

Return Value

int

at line 112
setType(int $var)

The entity type.

Generated from protobuf field .google.cloud.language.v1beta2.Entity.Type type = 2;

Parameters

int $var

at line 126
RepeatedField getMetadata()

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.

Generated from protobuf field map<string, string> metadata = 3;

Return Value

RepeatedField

at line 139
setMetadata(array|RepeatedField $var)

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.

Generated from protobuf field map<string, string> metadata = 3;

Parameters

array|RepeatedField $var

at line 155
float getSalience()

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.

Generated from protobuf field float salience = 4;

Return Value

float

at line 170
setSalience(float $var)

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.

Generated from protobuf field float salience = 4;

Parameters

float $var

at line 183
RepeatedField getMentions()

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

Generated from protobuf field repeated .google.cloud.language.v1beta2.EntityMention mentions = 5;

Return Value

RepeatedField

at line 195
setMentions(array|RepeatedField $var)

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

Generated from protobuf field repeated .google.cloud.language.v1beta2.EntityMention mentions = 5;

Parameters

array|RepeatedField $var

at line 210
Sentiment getSentiment()

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

Generated from protobuf field .google.cloud.language.v1beta2.Sentiment sentiment = 6;

Return Value

Sentiment

at line 224
setSentiment(Sentiment $var)

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

Generated from protobuf field .google.cloud.language.v1beta2.Sentiment sentiment = 6;

Parameters

Sentiment $var