Package com.google.cloud.language.v1
Class Entity
java.lang.Object
com.google.protobuf.AbstractMessageLite
com.google.protobuf.AbstractMessage
com.google.protobuf.GeneratedMessage
com.google.cloud.language.v1.Entity
- All Implemented Interfaces:
EntityOrBuilder,com.google.protobuf.Message,com.google.protobuf.MessageLite,com.google.protobuf.MessageLiteOrBuilder,com.google.protobuf.MessageOrBuilder,Serializable
@Generated
public final class Entity
extends com.google.protobuf.GeneratedMessage
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- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classRepresents a phrase in the text that is a known entity, such as a person, an organization, or location.static enumThe type of the entity.Nested classes/interfaces inherited from class com.google.protobuf.GeneratedMessage
com.google.protobuf.GeneratedMessage.ExtendableBuilder<MessageT extends com.google.protobuf.GeneratedMessage.ExtendableMessage<MessageT>,BuilderT extends com.google.protobuf.GeneratedMessage.ExtendableBuilder<MessageT, BuilderT>>, com.google.protobuf.GeneratedMessage.ExtendableMessage<MessageT extends com.google.protobuf.GeneratedMessage.ExtendableMessage<MessageT>>, com.google.protobuf.GeneratedMessage.ExtendableMessageOrBuilder<MessageT extends com.google.protobuf.GeneratedMessage.ExtendableMessage<MessageT>>, com.google.protobuf.GeneratedMessage.FieldAccessorTable, com.google.protobuf.GeneratedMessage.GeneratedExtension<ContainingT extends com.google.protobuf.Message, T extends Object>, com.google.protobuf.GeneratedMessage.UnusedPrivateParameter Nested classes/interfaces inherited from class com.google.protobuf.AbstractMessage
com.google.protobuf.AbstractMessage.BuilderParentNested classes/interfaces inherited from class com.google.protobuf.AbstractMessageLite
com.google.protobuf.AbstractMessageLite.InternalOneOfEnum -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intFields inherited from class com.google.protobuf.GeneratedMessage
alwaysUseFieldBuilders, loggedPre22TypeNames, unknownFieldsFields inherited from class com.google.protobuf.AbstractMessage
memoizedSizeFields inherited from class com.google.protobuf.AbstractMessageLite
memoizedHashCode -
Method Summary
Modifier and TypeMethodDescriptionbooleancontainsMetadata(String key) Metadata associated with the entity.booleanstatic Entitystatic final com.google.protobuf.Descriptors.DescriptorgetMentions(int index) The mentions of this entity in the input document.intThe mentions of this entity in the input document.The mentions of this entity in the input document.getMentionsOrBuilder(int index) The mentions of this entity in the input document.List<? extends EntityMentionOrBuilder>The mentions of this entity in the input document.Deprecated.intMetadata associated with the entity.Metadata associated with the entity.getMetadataOrDefault(String key, String defaultValue) Metadata associated with the entity.getMetadataOrThrow(String key) Metadata associated with the entity.getName()The representative name for the entity.com.google.protobuf.ByteStringThe representative name for the entity.com.google.protobuf.Parser<Entity>floatThe salience score associated with the entity in the [0, 1.0] range.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.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.intgetType()The entity type.intThe entity type.inthashCode()booleanFor 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 com.google.protobuf.GeneratedMessage.FieldAccessorTableprotected com.google.protobuf.MapFieldReflectionAccessorinternalGetMapFieldReflection(int number) final booleanstatic Entity.Builderstatic Entity.BuildernewBuilder(Entity prototype) protected Entity.BuildernewBuilderForType(com.google.protobuf.AbstractMessage.BuilderParent parent) static EntityparseDelimitedFrom(InputStream input) static EntityparseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static EntityparseFrom(byte[] data) static EntityparseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static EntityparseFrom(com.google.protobuf.ByteString data) static EntityparseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static EntityparseFrom(com.google.protobuf.CodedInputStream input) static EntityparseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static EntityparseFrom(InputStream input) static EntityparseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static EntityparseFrom(ByteBuffer data) static EntityparseFrom(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static com.google.protobuf.Parser<Entity>parser()voidwriteTo(com.google.protobuf.CodedOutputStream output) Methods inherited from class com.google.protobuf.GeneratedMessage
canUseUnsafe, computeStringSize, computeStringSizeNoTag, emptyBooleanList, emptyDoubleList, emptyFloatList, emptyIntList, emptyList, emptyLongList, getAllFields, getDescriptorForType, getField, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof, internalGetMapField, isStringEmpty, makeExtensionsImmutable, makeMutableCopy, makeMutableCopy, mergeFromAndMakeImmutableInternal, newFileScopedGeneratedExtension, newInstance, newMessageScopedGeneratedExtension, parseDelimitedWithIOException, parseDelimitedWithIOException, parseUnknownField, parseUnknownFieldProto3, parseWithIOException, parseWithIOException, parseWithIOException, parseWithIOException, serializeBooleanMapTo, serializeIntegerMapTo, serializeLongMapTo, serializeStringMapTo, writeReplace, writeString, writeStringNoTagMethods inherited from class com.google.protobuf.AbstractMessage
findInitializationErrors, getInitializationErrorString, hashFields, toStringMethods inherited from class com.google.protobuf.AbstractMessageLite
addAll, checkByteStringIsUtf8, toByteArray, toByteString, writeDelimitedTo, writeToMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.google.protobuf.MessageLite
toByteArray, toByteString, writeDelimitedTo, writeToMethods inherited from interface com.google.protobuf.MessageOrBuilder
findInitializationErrors, getAllFields, getDescriptorForType, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof
-
Field Details
-
NAME_FIELD_NUMBER
public static final int NAME_FIELD_NUMBER- See Also:
-
TYPE_FIELD_NUMBER
public static final int TYPE_FIELD_NUMBER- See Also:
-
METADATA_FIELD_NUMBER
public static final int METADATA_FIELD_NUMBER- See Also:
-
SALIENCE_FIELD_NUMBER
public static final int SALIENCE_FIELD_NUMBER- See Also:
-
MENTIONS_FIELD_NUMBER
public static final int MENTIONS_FIELD_NUMBER- See Also:
-
SENTIMENT_FIELD_NUMBER
public static final int SENTIMENT_FIELD_NUMBER- See Also:
-
-
Method Details
-
getDescriptor
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() -
internalGetMapFieldReflection
protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection(int number) - Overrides:
internalGetMapFieldReflectionin classcom.google.protobuf.GeneratedMessage
-
internalGetFieldAccessorTable
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()- Specified by:
internalGetFieldAccessorTablein classcom.google.protobuf.GeneratedMessage
-
getName
The representative name for the entity.
string name = 1;- Specified by:
getNamein interfaceEntityOrBuilder- Returns:
- The name.
-
getNameBytes
public com.google.protobuf.ByteString getNameBytes()The representative name for the entity.
string name = 1;- Specified by:
getNameBytesin interfaceEntityOrBuilder- Returns:
- The bytes for name.
-
getTypeValue
public int getTypeValue()The entity type.
.google.cloud.language.v1.Entity.Type type = 2;- Specified by:
getTypeValuein interfaceEntityOrBuilder- Returns:
- The enum numeric value on the wire for type.
-
getType
The entity type.
.google.cloud.language.v1.Entity.Type type = 2;- Specified by:
getTypein interfaceEntityOrBuilder- Returns:
- The type.
-
getMetadataCount
public int getMetadataCount()Description copied from interface:EntityOrBuilderMetadata 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;- Specified by:
getMetadataCountin interfaceEntityOrBuilder
-
containsMetadata
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;- Specified by:
containsMetadatain interfaceEntityOrBuilder
-
getMetadata
Deprecated.UsegetMetadataMap()instead.- Specified by:
getMetadatain interfaceEntityOrBuilder
-
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;- Specified by:
getMetadataMapin interfaceEntityOrBuilder
-
getMetadataOrDefault
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;- Specified by:
getMetadataOrDefaultin interfaceEntityOrBuilder
-
getMetadataOrThrow
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;- Specified by:
getMetadataOrThrowin interfaceEntityOrBuilder
-
getSalience
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;- Specified by:
getSaliencein interfaceEntityOrBuilder- Returns:
- The salience.
-
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;- Specified by:
getMentionsListin interfaceEntityOrBuilder
-
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;- Specified by:
getMentionsOrBuilderListin interfaceEntityOrBuilder
-
getMentionsCount
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;- Specified by:
getMentionsCountin interfaceEntityOrBuilder
-
getMentions
The mentions of this entity in the input document. The API currently supports proper noun mentions.
repeated .google.cloud.language.v1.EntityMention mentions = 5;- Specified by:
getMentionsin interfaceEntityOrBuilder
-
getMentionsOrBuilder
The mentions of this entity in the input document. The API currently supports proper noun mentions.
repeated .google.cloud.language.v1.EntityMention mentions = 5;- Specified by:
getMentionsOrBuilderin interfaceEntityOrBuilder
-
hasSentiment
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;- Specified by:
hasSentimentin interfaceEntityOrBuilder- Returns:
- Whether the sentiment field is set.
-
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;- Specified by:
getSentimentin interfaceEntityOrBuilder- Returns:
- The sentiment.
-
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;- Specified by:
getSentimentOrBuilderin interfaceEntityOrBuilder
-
isInitialized
public final boolean isInitialized()- Specified by:
isInitializedin interfacecom.google.protobuf.MessageLiteOrBuilder- Overrides:
isInitializedin classcom.google.protobuf.GeneratedMessage
-
writeTo
- Specified by:
writeToin interfacecom.google.protobuf.MessageLite- Overrides:
writeToin classcom.google.protobuf.GeneratedMessage- Throws:
IOException
-
getSerializedSize
public int getSerializedSize()- Specified by:
getSerializedSizein interfacecom.google.protobuf.MessageLite- Overrides:
getSerializedSizein classcom.google.protobuf.GeneratedMessage
-
equals
- Specified by:
equalsin interfacecom.google.protobuf.Message- Overrides:
equalsin classcom.google.protobuf.AbstractMessage
-
hashCode
public int hashCode()- Specified by:
hashCodein interfacecom.google.protobuf.Message- Overrides:
hashCodein classcom.google.protobuf.AbstractMessage
-
parseFrom
public static Entity parseFrom(ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static Entity parseFrom(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static Entity parseFrom(com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static Entity parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static Entity parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static Entity parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
- Throws:
IOException
-
parseFrom
public static Entity parseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException - Throws:
IOException
-
parseDelimitedFrom
- Throws:
IOException
-
parseDelimitedFrom
public static Entity parseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException - Throws:
IOException
-
parseFrom
- Throws:
IOException
-
parseFrom
public static Entity parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException - Throws:
IOException
-
newBuilderForType
- Specified by:
newBuilderForTypein interfacecom.google.protobuf.Message- Specified by:
newBuilderForTypein interfacecom.google.protobuf.MessageLite
-
newBuilder
-
newBuilder
-
toBuilder
- Specified by:
toBuilderin interfacecom.google.protobuf.Message- Specified by:
toBuilderin interfacecom.google.protobuf.MessageLite
-
newBuilderForType
protected Entity.Builder newBuilderForType(com.google.protobuf.AbstractMessage.BuilderParent parent) - Overrides:
newBuilderForTypein classcom.google.protobuf.AbstractMessage
-
getDefaultInstance
-
parser
-
getParserForType
- Specified by:
getParserForTypein interfacecom.google.protobuf.Message- Specified by:
getParserForTypein interfacecom.google.protobuf.MessageLite- Overrides:
getParserForTypein classcom.google.protobuf.GeneratedMessage
-
getDefaultInstanceForType
- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageLiteOrBuilder- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageOrBuilder
-