public static final class Entity.Builder extends GeneratedMessageV3.Builder<Entity.Builder> 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 | Method and Description |
---|---|
Entity.Builder |
addAllMentions(java.lang.Iterable<? extends EntityMention> values)
The mentions of this entity in the input document.
|
Entity.Builder |
addMentions(EntityMention.Builder builderForValue)
The mentions of this entity in the input document.
|
Entity.Builder |
addMentions(EntityMention value)
The mentions of this entity in the input document.
|
Entity.Builder |
addMentions(int index,
EntityMention.Builder builderForValue)
The mentions of this entity in the input document.
|
Entity.Builder |
addMentions(int index,
EntityMention value)
The mentions of this entity in the input document.
|
EntityMention.Builder |
addMentionsBuilder()
The mentions of this entity in the input document.
|
EntityMention.Builder |
addMentionsBuilder(int index)
The mentions of this entity in the input document.
|
Entity.Builder |
addRepeatedField(Descriptors.FieldDescriptor field,
java.lang.Object value) |
Entity |
build() |
Entity |
buildPartial() |
Entity.Builder |
clear() |
Entity.Builder |
clearField(Descriptors.FieldDescriptor field) |
Entity.Builder |
clearMentions()
The mentions of this entity in the input document.
|
Entity.Builder |
clearMetadata() |
Entity.Builder |
clearName()
The representative name for the entity.
|
Entity.Builder |
clearOneof(Descriptors.OneofDescriptor oneof) |
Entity.Builder |
clearSalience()
The salience score associated with the entity in the [0, 1.0] range.
|
Entity.Builder |
clearSentiment()
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.
|
Entity.Builder |
clearType()
The entity type.
|
Entity.Builder |
clone() |
boolean |
containsMetadata(java.lang.String key)
Metadata associated with the entity.
|
Entity |
getDefaultInstanceForType() |
static Descriptors.Descriptor |
getDescriptor() |
Descriptors.Descriptor |
getDescriptorForType() |
EntityMention |
getMentions(int index)
The mentions of this entity in the input document.
|
EntityMention.Builder |
getMentionsBuilder(int index)
The mentions of this entity in the input document.
|
java.util.List<EntityMention.Builder> |
getMentionsBuilderList()
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.util.Map<java.lang.String,java.lang.String> |
getMutableMetadata()
Deprecated.
|
java.lang.String |
getName()
The representative name for the entity.
|
ByteString |
getNameBytes()
The representative name for the entity.
|
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.
|
Sentiment.Builder |
getSentimentBuilder()
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.
|
Entity.Type |
getType()
The entity type.
|
int |
getTypeValue()
The entity type.
|
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) |
protected MapField |
internalGetMutableMapField(int number) |
boolean |
isInitialized() |
Entity.Builder |
mergeFrom(CodedInputStream input,
ExtensionRegistryLite extensionRegistry) |
Entity.Builder |
mergeFrom(Entity other) |
Entity.Builder |
mergeFrom(Message other) |
Entity.Builder |
mergeSentiment(Sentiment value)
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.
|
Entity.Builder |
mergeUnknownFields(UnknownFieldSet unknownFields) |
Entity.Builder |
putAllMetadata(java.util.Map<java.lang.String,java.lang.String> values)
Metadata associated with the entity.
|
Entity.Builder |
putMetadata(java.lang.String key,
java.lang.String value)
Metadata associated with the entity.
|
Entity.Builder |
removeMentions(int index)
The mentions of this entity in the input document.
|
Entity.Builder |
removeMetadata(java.lang.String key)
Metadata associated with the entity.
|
Entity.Builder |
setField(Descriptors.FieldDescriptor field,
java.lang.Object value) |
Entity.Builder |
setMentions(int index,
EntityMention.Builder builderForValue)
The mentions of this entity in the input document.
|
Entity.Builder |
setMentions(int index,
EntityMention value)
The mentions of this entity in the input document.
|
Entity.Builder |
setName(java.lang.String value)
The representative name for the entity.
|
Entity.Builder |
setNameBytes(ByteString value)
The representative name for the entity.
|
Entity.Builder |
setRepeatedField(Descriptors.FieldDescriptor field,
int index,
java.lang.Object value) |
Entity.Builder |
setSalience(float value)
The salience score associated with the entity in the [0, 1.0] range.
|
Entity.Builder |
setSentiment(Sentiment.Builder builderForValue)
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.
|
Entity.Builder |
setSentiment(Sentiment value)
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.
|
Entity.Builder |
setType(Entity.Type value)
The entity type.
|
Entity.Builder |
setTypeValue(int value)
The entity type.
|
Entity.Builder |
setUnknownFields(UnknownFieldSet unknownFields) |
getAllFields, getField, getFieldBuilder, getOneofFieldDescriptor, getParentForChildren, getRepeatedField, getRepeatedFieldBuilder, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof, isClean, markClean, newBuilderForField, onBuilt, onChanged, setUnknownFieldsProto3
findInitializationErrors, getInitializationErrorString, internalMergeFrom, mergeDelimitedFrom, mergeDelimitedFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, newUninitializedMessageException, toString
addAll, addAll, mergeFrom, newUninitializedMessageException
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
findInitializationErrors, getAllFields, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof
mergeFrom
public static final Descriptors.Descriptor getDescriptor()
protected MapField internalGetMapField(int number)
internalGetMapField
in class GeneratedMessageV3.Builder<Entity.Builder>
protected MapField internalGetMutableMapField(int number)
internalGetMutableMapField
in class GeneratedMessageV3.Builder<Entity.Builder>
protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
internalGetFieldAccessorTable
in class GeneratedMessageV3.Builder<Entity.Builder>
public Entity.Builder clear()
clear
in interface Message.Builder
clear
in interface MessageLite.Builder
clear
in class GeneratedMessageV3.Builder<Entity.Builder>
public Descriptors.Descriptor getDescriptorForType()
getDescriptorForType
in interface Message.Builder
getDescriptorForType
in interface MessageOrBuilder
getDescriptorForType
in class GeneratedMessageV3.Builder<Entity.Builder>
public Entity getDefaultInstanceForType()
getDefaultInstanceForType
in interface MessageLiteOrBuilder
getDefaultInstanceForType
in interface MessageOrBuilder
public Entity build()
build
in interface Message.Builder
build
in interface MessageLite.Builder
public Entity buildPartial()
buildPartial
in interface Message.Builder
buildPartial
in interface MessageLite.Builder
public Entity.Builder clone()
clone
in interface Message.Builder
clone
in interface MessageLite.Builder
clone
in class GeneratedMessageV3.Builder<Entity.Builder>
public Entity.Builder setField(Descriptors.FieldDescriptor field, java.lang.Object value)
setField
in interface Message.Builder
setField
in class GeneratedMessageV3.Builder<Entity.Builder>
public Entity.Builder clearField(Descriptors.FieldDescriptor field)
clearField
in interface Message.Builder
clearField
in class GeneratedMessageV3.Builder<Entity.Builder>
public Entity.Builder clearOneof(Descriptors.OneofDescriptor oneof)
clearOneof
in interface Message.Builder
clearOneof
in class GeneratedMessageV3.Builder<Entity.Builder>
public Entity.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, java.lang.Object value)
setRepeatedField
in interface Message.Builder
setRepeatedField
in class GeneratedMessageV3.Builder<Entity.Builder>
public Entity.Builder addRepeatedField(Descriptors.FieldDescriptor field, java.lang.Object value)
addRepeatedField
in interface Message.Builder
addRepeatedField
in class GeneratedMessageV3.Builder<Entity.Builder>
public Entity.Builder mergeFrom(Message other)
mergeFrom
in interface Message.Builder
mergeFrom
in class AbstractMessage.Builder<Entity.Builder>
public Entity.Builder mergeFrom(Entity other)
public final boolean isInitialized()
isInitialized
in interface MessageLiteOrBuilder
isInitialized
in class GeneratedMessageV3.Builder<Entity.Builder>
public Entity.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry) throws java.io.IOException
mergeFrom
in interface Message.Builder
mergeFrom
in interface MessageLite.Builder
mergeFrom
in class AbstractMessage.Builder<Entity.Builder>
java.io.IOException
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 Entity.Builder setName(java.lang.String value)
The representative name for the entity.
string name = 1;
public Entity.Builder clearName()
The representative name for the entity.
string name = 1;
public Entity.Builder setNameBytes(ByteString value)
The representative name for the entity.
string name = 1;
public int getTypeValue()
The entity type.
.google.cloud.language.v1.Entity.Type type = 2;
getTypeValue
in interface EntityOrBuilder
public Entity.Builder setTypeValue(int value)
The entity type.
.google.cloud.language.v1.Entity.Type type = 2;
public Entity.Type getType()
The entity type.
.google.cloud.language.v1.Entity.Type type = 2;
getType
in interface EntityOrBuilder
public Entity.Builder setType(Entity.Type value)
The entity type.
.google.cloud.language.v1.Entity.Type type = 2;
public Entity.Builder clearType()
The entity type.
.google.cloud.language.v1.Entity.Type type = 2;
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 Entity.Builder clearMetadata()
public Entity.Builder removeMetadata(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;
@Deprecated public java.util.Map<java.lang.String,java.lang.String> getMutableMetadata()
public Entity.Builder putMetadata(java.lang.String key, java.lang.String value)
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;
public Entity.Builder putAllMetadata(java.util.Map<java.lang.String,java.lang.String> values)
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;
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 Entity.Builder setSalience(float value)
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;
public Entity.Builder clearSalience()
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;
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.v1.EntityMention mentions = 5;
getMentionsList
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 Entity.Builder setMentions(int index, EntityMention value)
The mentions of this entity in the input document. The API currently supports proper noun mentions.
repeated .google.cloud.language.v1.EntityMention mentions = 5;
public Entity.Builder setMentions(int index, EntityMention.Builder builderForValue)
The mentions of this entity in the input document. The API currently supports proper noun mentions.
repeated .google.cloud.language.v1.EntityMention mentions = 5;
public Entity.Builder addMentions(EntityMention value)
The mentions of this entity in the input document. The API currently supports proper noun mentions.
repeated .google.cloud.language.v1.EntityMention mentions = 5;
public Entity.Builder addMentions(int index, EntityMention value)
The mentions of this entity in the input document. The API currently supports proper noun mentions.
repeated .google.cloud.language.v1.EntityMention mentions = 5;
public Entity.Builder addMentions(EntityMention.Builder builderForValue)
The mentions of this entity in the input document. The API currently supports proper noun mentions.
repeated .google.cloud.language.v1.EntityMention mentions = 5;
public Entity.Builder addMentions(int index, EntityMention.Builder builderForValue)
The mentions of this entity in the input document. The API currently supports proper noun mentions.
repeated .google.cloud.language.v1.EntityMention mentions = 5;
public Entity.Builder addAllMentions(java.lang.Iterable<? extends EntityMention> values)
The mentions of this entity in the input document. The API currently supports proper noun mentions.
repeated .google.cloud.language.v1.EntityMention mentions = 5;
public Entity.Builder clearMentions()
The mentions of this entity in the input document. The API currently supports proper noun mentions.
repeated .google.cloud.language.v1.EntityMention mentions = 5;
public Entity.Builder removeMentions(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;
public EntityMention.Builder getMentionsBuilder(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;
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 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.v1.EntityMention mentions = 5;
getMentionsOrBuilderList
in interface EntityOrBuilder
public EntityMention.Builder addMentionsBuilder()
The mentions of this entity in the input document. The API currently supports proper noun mentions.
repeated .google.cloud.language.v1.EntityMention mentions = 5;
public EntityMention.Builder addMentionsBuilder(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;
public java.util.List<EntityMention.Builder> getMentionsBuilderList()
The mentions of this entity in the input document. The API currently supports proper noun mentions.
repeated .google.cloud.language.v1.EntityMention mentions = 5;
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 Entity.Builder setSentiment(Sentiment value)
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;
public Entity.Builder setSentiment(Sentiment.Builder builderForValue)
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;
public Entity.Builder mergeSentiment(Sentiment value)
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;
public Entity.Builder clearSentiment()
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;
public Sentiment.Builder getSentimentBuilder()
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;
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 Entity.Builder setUnknownFields(UnknownFieldSet unknownFields)
setUnknownFields
in interface Message.Builder
setUnknownFields
in class GeneratedMessageV3.Builder<Entity.Builder>
public final Entity.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
mergeUnknownFields
in interface Message.Builder
mergeUnknownFields
in class GeneratedMessageV3.Builder<Entity.Builder>