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.v1beta2.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
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(java.lang.String key)
Metadata associated with the entity.
|
boolean |
equals(java.lang.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.
|
java.util.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.
|
java.util.List<? extends EntityMentionOrBuilder> |
getMentionsOrBuilderList()
The mentions of this entity in the input document.
|
java.util.Map<java.lang.String,java.lang.String> |
getMetadata()
Deprecated.
|
int |
getMetadataCount()
Metadata associated with the entity.
|
java.util.Map<java.lang.String,java.lang.String> |
getMetadataMap()
Metadata associated with the entity.
|
java.lang.String |
getMetadataOrDefault(java.lang.String key,
java.lang.String defaultValue)
Metadata associated with the entity.
|
java.lang.String |
getMetadataOrThrow(java.lang.String key)
Metadata associated with the entity.
|
java.lang.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.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.
|
SentimentOrBuilder |
getSentimentOrBuilder()
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.
|
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.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.
|
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) |
static Entity |
parseDelimitedFrom(java.io.InputStream input) |
static Entity |
parseDelimitedFrom(java.io.InputStream input,
ExtensionRegistryLite extensionRegistry) |
static Entity |
parseFrom(byte[] data) |
static Entity |
parseFrom(byte[] data,
ExtensionRegistryLite extensionRegistry) |
static Entity |
parseFrom(java.nio.ByteBuffer data) |
static Entity |
parseFrom(java.nio.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(java.io.InputStream input) |
static Entity |
parseFrom(java.io.InputStream input,
ExtensionRegistryLite extensionRegistry) |
static Parser<Entity> |
parser() |
Entity.Builder |
toBuilder() |
void |
writeTo(CodedOutputStream output) |
canUseUnsafe, computeStringSize, computeStringSizeNoTag, getAllFields, getDescriptorForType, getField, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, hasField, hasOneof, makeExtensionsImmutable, newBuilderForType, 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
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 java.lang.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.v1beta2.Entity.Type type = 2;
getTypeValue
in interface EntityOrBuilder
public Entity.Type getType()
The entity type.
.google.cloud.language.v1beta2.Entity.Type type = 2;
getType
in interface EntityOrBuilder
public int getMetadataCount()
EntityOrBuilder
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.
map<string, string> metadata = 3;
getMetadataCount
in interface EntityOrBuilder
public boolean containsMetadata(java.lang.String key)
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.
map<string, string> metadata = 3;
containsMetadata
in interface EntityOrBuilder
@Deprecated public java.util.Map<java.lang.String,java.lang.String> getMetadata()
getMetadataMap()
instead.getMetadata
in interface EntityOrBuilder
public java.util.Map<java.lang.String,java.lang.String> getMetadataMap()
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.
map<string, string> metadata = 3;
getMetadataMap
in interface EntityOrBuilder
public java.lang.String getMetadataOrDefault(java.lang.String key, java.lang.String defaultValue)
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.
map<string, string> metadata = 3;
getMetadataOrDefault
in interface EntityOrBuilder
public java.lang.String getMetadataOrThrow(java.lang.String key)
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.
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 java.util.List<EntityMention> getMentionsList()
The mentions of this entity in the input document. The API currently supports proper noun mentions.
repeated .google.cloud.language.v1beta2.EntityMention mentions = 5;
getMentionsList
in interface EntityOrBuilder
public java.util.List<? extends EntityMentionOrBuilder> getMentionsOrBuilderList()
The mentions of this entity in the input document. The API currently supports proper noun mentions.
repeated .google.cloud.language.v1beta2.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.v1beta2.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.v1beta2.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.v1beta2.EntityMention mentions = 5;
getMentionsOrBuilder
in interface EntityOrBuilder
public boolean hasSentiment()
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.
.google.cloud.language.v1beta2.Sentiment sentiment = 6;
hasSentiment
in interface EntityOrBuilder
public 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.
.google.cloud.language.v1beta2.Sentiment sentiment = 6;
getSentiment
in interface EntityOrBuilder
public SentimentOrBuilder getSentimentOrBuilder()
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.
.google.cloud.language.v1beta2.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 java.io.IOException
writeTo
in interface MessageLite
writeTo
in class GeneratedMessageV3
java.io.IOException
public int getSerializedSize()
getSerializedSize
in interface MessageLite
getSerializedSize
in class GeneratedMessageV3
public boolean equals(java.lang.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(java.nio.ByteBuffer data) throws InvalidProtocolBufferException
InvalidProtocolBufferException
public static Entity parseFrom(java.nio.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(java.io.InputStream input) throws java.io.IOException
java.io.IOException
public static Entity parseFrom(java.io.InputStream input, ExtensionRegistryLite extensionRegistry) throws java.io.IOException
java.io.IOException
public static Entity parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException
java.io.IOException
public static Entity parseDelimitedFrom(java.io.InputStream input, ExtensionRegistryLite extensionRegistry) throws java.io.IOException
java.io.IOException
public static Entity parseFrom(CodedInputStream input) throws java.io.IOException
java.io.IOException
public static Entity parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry) throws java.io.IOException
java.io.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