public final class Entity extends GeneratedMessageV3 implements EntityOrBuilder
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.v1.Entity
Modifier and Type | Class and Description |
---|---|
static class |
Entity.Builder
Represents a phrase in the text that is a known entity, such as
a person, an organization, or location.
|
static class |
Entity.Type
The type of the entity.
|
GeneratedMessageV3.BuilderParent, GeneratedMessageV3.ExtendableBuilder<MessageType extends GeneratedMessageV3.ExtendableMessage,BuilderType extends GeneratedMessageV3.ExtendableBuilder<MessageType,BuilderType>>, GeneratedMessageV3.ExtendableMessage<MessageType extends GeneratedMessageV3.ExtendableMessage>, GeneratedMessageV3.ExtendableMessageOrBuilder<MessageType extends GeneratedMessageV3.ExtendableMessage>, GeneratedMessageV3.FieldAccessorTable, GeneratedMessageV3.UnusedPrivateParameter
AbstractMessageLite.InternalOneOfEnum
Modifier and Type | Field and Description |
---|---|
static int |
MENTIONS_FIELD_NUMBER |
static int |
METADATA_FIELD_NUMBER |
static int |
NAME_FIELD_NUMBER |
static int |
SALIENCE_FIELD_NUMBER |
static int |
SENTIMENT_FIELD_NUMBER |
static int |
TYPE_FIELD_NUMBER |
alwaysUseFieldBuilders, unknownFields
memoizedSize
memoizedHashCode
Modifier and Type | Method and Description |
---|---|
boolean |
containsMetadata(String key)
Metadata associated with the entity.
|
boolean |
equals(Object obj) |
static Entity |
getDefaultInstance() |
Entity |
getDefaultInstanceForType() |
static Descriptors.Descriptor |
getDescriptor() |
EntityMention |
getMentions(int index)
The mentions of this entity in the input document.
|
int |
getMentionsCount()
The mentions of this entity in the input document.
|
List<EntityMention> |
getMentionsList()
The mentions of this entity in the input document.
|
EntityMentionOrBuilder |
getMentionsOrBuilder(int index)
The mentions of this entity in the input document.
|
List<? extends EntityMentionOrBuilder> |
getMentionsOrBuilderList()
The mentions of this entity in the input document.
|
Map<String,String> |
getMetadata()
Deprecated.
|
int |
getMetadataCount()
Metadata associated with the entity.
|
Map<String,String> |
getMetadataMap()
Metadata associated with the entity.
|
String |
getMetadataOrDefault(String key,
String defaultValue)
Metadata associated with the entity.
|
String |
getMetadataOrThrow(String key)
Metadata associated with the entity.
|
String |
getName()
The representative name for the entity.
|
ByteString |
getNameBytes()
The representative name for the entity.
|
Parser<Entity> |
getParserForType() |
float |
getSalience()
The salience score associated with the entity in the [0, 1.0] range.
|
Sentiment |
getSentiment()
For calls to [AnalyzeEntitySentiment][] or if
[AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment] is set to
true, this field will contain the aggregate sentiment expressed for this
entity in the provided document.
|
SentimentOrBuilder |
getSentimentOrBuilder()
For calls to [AnalyzeEntitySentiment][] or if
[AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment] is set to
true, this field will contain the aggregate sentiment expressed for this
entity in the provided document.
|
int |
getSerializedSize() |
Entity.Type |
getType()
The entity type.
|
int |
getTypeValue()
The entity type.
|
UnknownFieldSet |
getUnknownFields() |
int |
hashCode() |
boolean |
hasSentiment()
For calls to [AnalyzeEntitySentiment][] or if
[AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment] is set to
true, this field will contain the aggregate sentiment expressed for this
entity in the provided document.
|
protected GeneratedMessageV3.FieldAccessorTable |
internalGetFieldAccessorTable() |
protected MapField |
internalGetMapField(int number) |
boolean |
isInitialized() |
static Entity.Builder |
newBuilder() |
static Entity.Builder |
newBuilder(Entity prototype) |
Entity.Builder |
newBuilderForType() |
protected Entity.Builder |
newBuilderForType(GeneratedMessageV3.BuilderParent parent) |
protected Object |
newInstance(GeneratedMessageV3.UnusedPrivateParameter unused) |
static Entity |
parseDelimitedFrom(InputStream input) |
static Entity |
parseDelimitedFrom(InputStream input,
ExtensionRegistryLite extensionRegistry) |
static Entity |
parseFrom(byte[] data) |
static Entity |
parseFrom(byte[] data,
ExtensionRegistryLite extensionRegistry) |
static Entity |
parseFrom(ByteBuffer data) |
static Entity |
parseFrom(ByteBuffer data,
ExtensionRegistryLite extensionRegistry) |
static Entity |
parseFrom(ByteString data) |
static Entity |
parseFrom(ByteString data,
ExtensionRegistryLite extensionRegistry) |
static Entity |
parseFrom(CodedInputStream input) |
static Entity |
parseFrom(CodedInputStream input,
ExtensionRegistryLite extensionRegistry) |
static Entity |
parseFrom(InputStream input) |
static Entity |
parseFrom(InputStream input,
ExtensionRegistryLite extensionRegistry) |
static Parser<Entity> |
parser() |
Entity.Builder |
toBuilder() |
void |
writeTo(CodedOutputStream output) |
canUseUnsafe, computeStringSize, computeStringSizeNoTag, emptyBooleanList, emptyDoubleList, emptyFloatList, emptyIntList, emptyLongList, getAllFields, getDescriptorForType, getField, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, hasField, hasOneof, isStringEmpty, makeExtensionsImmutable, mergeFromAndMakeImmutableInternal, mutableCopy, mutableCopy, mutableCopy, mutableCopy, mutableCopy, newBooleanList, newBuilderForType, newDoubleList, newFloatList, newIntList, newLongList, parseDelimitedWithIOException, parseDelimitedWithIOException, parseUnknownField, parseUnknownFieldProto3, parseWithIOException, parseWithIOException, parseWithIOException, parseWithIOException, serializeBooleanMapTo, serializeIntegerMapTo, serializeLongMapTo, serializeStringMapTo, writeReplace, writeString, writeStringNoTag
findInitializationErrors, getInitializationErrorString, hashBoolean, hashEnum, hashEnumList, hashFields, hashLong, toString
addAll, addAll, checkByteStringIsUtf8, toByteArray, toByteString, writeDelimitedTo, writeTo
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
findInitializationErrors, getAllFields, getDescriptorForType, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, hasField, hasOneof
toByteArray, toByteString, writeDelimitedTo, writeTo
public static final int NAME_FIELD_NUMBER
public static final int TYPE_FIELD_NUMBER
public static final int METADATA_FIELD_NUMBER
public static final int SALIENCE_FIELD_NUMBER
public static final int MENTIONS_FIELD_NUMBER
public static final int SENTIMENT_FIELD_NUMBER
protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
newInstance
in class GeneratedMessageV3
public final UnknownFieldSet getUnknownFields()
getUnknownFields
in interface MessageOrBuilder
getUnknownFields
in class GeneratedMessageV3
public static final Descriptors.Descriptor getDescriptor()
protected MapField internalGetMapField(int number)
internalGetMapField
in class GeneratedMessageV3
protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
internalGetFieldAccessorTable
in class GeneratedMessageV3
public String getName()
The representative name for the entity.
string name = 1;
getName
in interface EntityOrBuilder
public ByteString getNameBytes()
The representative name for the entity.
string name = 1;
getNameBytes
in interface EntityOrBuilder
public int getTypeValue()
The entity type.
.google.cloud.language.v1.Entity.Type type = 2;
getTypeValue
in interface EntityOrBuilder
public Entity.Type getType()
The entity type.
.google.cloud.language.v1.Entity.Type type = 2;
getType
in interface EntityOrBuilder
public int getMetadataCount()
EntityOrBuilder
Metadata associated with the entity. For most entity types, the metadata is a Wikipedia URL (`wikipedia_url`) and Knowledge Graph MID (`mid`), if they are available. For the metadata associated with other entity types, see the Type table below.
map<string, string> metadata = 3;
getMetadataCount
in interface EntityOrBuilder
public boolean containsMetadata(String key)
Metadata associated with the entity. For most entity types, the metadata is a Wikipedia URL (`wikipedia_url`) and Knowledge Graph MID (`mid`), if they are available. For the metadata associated with other entity types, see the Type table below.
map<string, string> metadata = 3;
containsMetadata
in interface EntityOrBuilder
@Deprecated public Map<String,String> getMetadata()
getMetadataMap()
instead.getMetadata
in interface EntityOrBuilder
public Map<String,String> getMetadataMap()
Metadata associated with the entity. For most entity types, the metadata is a Wikipedia URL (`wikipedia_url`) and Knowledge Graph MID (`mid`), if they are available. For the metadata associated with other entity types, see the Type table below.
map<string, string> metadata = 3;
getMetadataMap
in interface EntityOrBuilder
public String getMetadataOrDefault(String key, String defaultValue)
Metadata associated with the entity. For most entity types, the metadata is a Wikipedia URL (`wikipedia_url`) and Knowledge Graph MID (`mid`), if they are available. For the metadata associated with other entity types, see the Type table below.
map<string, string> metadata = 3;
getMetadataOrDefault
in interface EntityOrBuilder
public String getMetadataOrThrow(String key)
Metadata associated with the entity. For most entity types, the metadata is a Wikipedia URL (`wikipedia_url`) and Knowledge Graph MID (`mid`), if they are available. For the metadata associated with other entity types, see the Type table below.
map<string, string> metadata = 3;
getMetadataOrThrow
in interface EntityOrBuilder
public 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.
float salience = 4;
getSalience
in interface EntityOrBuilder
public List<EntityMention> getMentionsList()
The mentions of this entity in the input document. The API currently supports proper noun mentions.
repeated .google.cloud.language.v1.EntityMention mentions = 5;
getMentionsList
in interface EntityOrBuilder
public List<? extends EntityMentionOrBuilder> getMentionsOrBuilderList()
The mentions of this entity in the input document. The API currently supports proper noun mentions.
repeated .google.cloud.language.v1.EntityMention mentions = 5;
getMentionsOrBuilderList
in interface EntityOrBuilder
public int getMentionsCount()
The mentions of this entity in the input document. The API currently supports proper noun mentions.
repeated .google.cloud.language.v1.EntityMention mentions = 5;
getMentionsCount
in interface EntityOrBuilder
public EntityMention getMentions(int index)
The mentions of this entity in the input document. The API currently supports proper noun mentions.
repeated .google.cloud.language.v1.EntityMention mentions = 5;
getMentions
in interface EntityOrBuilder
public EntityMentionOrBuilder getMentionsOrBuilder(int index)
The mentions of this entity in the input document. The API currently supports proper noun mentions.
repeated .google.cloud.language.v1.EntityMention mentions = 5;
getMentionsOrBuilder
in interface EntityOrBuilder
public boolean hasSentiment()
For calls to [AnalyzeEntitySentiment][] or if [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment] is set to true, this field will contain the aggregate sentiment expressed for this entity in the provided document.
.google.cloud.language.v1.Sentiment sentiment = 6;
hasSentiment
in interface EntityOrBuilder
public Sentiment getSentiment()
For calls to [AnalyzeEntitySentiment][] or if [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment] is set to true, this field will contain the aggregate sentiment expressed for this entity in the provided document.
.google.cloud.language.v1.Sentiment sentiment = 6;
getSentiment
in interface EntityOrBuilder
public SentimentOrBuilder getSentimentOrBuilder()
For calls to [AnalyzeEntitySentiment][] or if [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment] is set to true, this field will contain the aggregate sentiment expressed for this entity in the provided document.
.google.cloud.language.v1.Sentiment sentiment = 6;
getSentimentOrBuilder
in interface EntityOrBuilder
public final boolean isInitialized()
isInitialized
in interface MessageLiteOrBuilder
isInitialized
in class GeneratedMessageV3
public void writeTo(CodedOutputStream output) throws IOException
writeTo
in interface MessageLite
writeTo
in class GeneratedMessageV3
IOException
public int getSerializedSize()
getSerializedSize
in interface MessageLite
getSerializedSize
in class GeneratedMessageV3
public boolean equals(Object obj)
equals
in interface Message
equals
in class AbstractMessage
public int hashCode()
hashCode
in interface Message
hashCode
in class AbstractMessage
public static Entity parseFrom(ByteBuffer data) throws InvalidProtocolBufferException
InvalidProtocolBufferException
public static Entity parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry) throws InvalidProtocolBufferException
InvalidProtocolBufferException
public static Entity parseFrom(ByteString data) throws InvalidProtocolBufferException
InvalidProtocolBufferException
public static Entity parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry) throws InvalidProtocolBufferException
InvalidProtocolBufferException
public static Entity parseFrom(byte[] data) throws InvalidProtocolBufferException
InvalidProtocolBufferException
public static Entity parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry) throws InvalidProtocolBufferException
InvalidProtocolBufferException
public static Entity parseFrom(InputStream input) throws IOException
IOException
public static Entity parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry) throws IOException
IOException
public static Entity parseDelimitedFrom(InputStream input) throws IOException
IOException
public static Entity parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry) throws IOException
IOException
public static Entity parseFrom(CodedInputStream input) throws IOException
IOException
public static Entity parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry) throws IOException
IOException
public Entity.Builder newBuilderForType()
newBuilderForType
in interface Message
newBuilderForType
in interface MessageLite
public static Entity.Builder newBuilder()
public static Entity.Builder newBuilder(Entity prototype)
public Entity.Builder toBuilder()
toBuilder
in interface Message
toBuilder
in interface MessageLite
protected Entity.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
newBuilderForType
in class GeneratedMessageV3
public static Entity getDefaultInstance()
public Parser<Entity> getParserForType()
getParserForType
in interface Message
getParserForType
in interface MessageLite
getParserForType
in class GeneratedMessageV3
public Entity getDefaultInstanceForType()
getDefaultInstanceForType
in interface MessageLiteOrBuilder
getDefaultInstanceForType
in interface MessageOrBuilder
Copyright © 2022 Google LLC. All rights reserved.