Class EntityMention.Builder (2.32.0)

public static final class EntityMention.Builder extends GeneratedMessageV3.Builder<EntityMention.Builder> implements EntityMentionOrBuilder

Represents a mention for an entity in the text. Currently, proper noun mentions are supported.

Protobuf type google.cloud.language.v2.EntityMention

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
TypeDescription
Descriptor

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public EntityMention.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
EntityMention.Builder
Overrides

build()

public EntityMention build()
Returns
TypeDescription
EntityMention

buildPartial()

public EntityMention buildPartial()
Returns
TypeDescription
EntityMention

clear()

public EntityMention.Builder clear()
Returns
TypeDescription
EntityMention.Builder
Overrides

clearField(Descriptors.FieldDescriptor field)

public EntityMention.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
NameDescription
fieldFieldDescriptor
Returns
TypeDescription
EntityMention.Builder
Overrides

clearOneof(Descriptors.OneofDescriptor oneof)

public EntityMention.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
NameDescription
oneofOneofDescriptor
Returns
TypeDescription
EntityMention.Builder
Overrides

clearProbability()

public EntityMention.Builder clearProbability()

Probability score associated with the entity.

The score shows the probability of the entity mention being the entity type. The score is in (0, 1] range.

float probability = 4;

Returns
TypeDescription
EntityMention.Builder

This builder for chaining.

clearSentiment()

public EntityMention.Builder clearSentiment()

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

.google.cloud.language.v2.Sentiment sentiment = 3;

Returns
TypeDescription
EntityMention.Builder

clearText()

public EntityMention.Builder clearText()

The mention text.

.google.cloud.language.v2.TextSpan text = 1;

Returns
TypeDescription
EntityMention.Builder

clearType()

public EntityMention.Builder clearType()

The type of the entity mention.

.google.cloud.language.v2.EntityMention.Type type = 2;

Returns
TypeDescription
EntityMention.Builder

This builder for chaining.

clone()

public EntityMention.Builder clone()
Returns
TypeDescription
EntityMention.Builder
Overrides

getDefaultInstanceForType()

public EntityMention getDefaultInstanceForType()
Returns
TypeDescription
EntityMention

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
Descriptor
Overrides

getProbability()

public float getProbability()

Probability score associated with the entity.

The score shows the probability of the entity mention being the entity type. The score is in (0, 1] range.

float probability = 4;

Returns
TypeDescription
float

The probability.

getSentiment()

public Sentiment getSentiment()

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

.google.cloud.language.v2.Sentiment sentiment = 3;

Returns
TypeDescription
Sentiment

The sentiment.

getSentimentBuilder()

public Sentiment.Builder getSentimentBuilder()

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

.google.cloud.language.v2.Sentiment sentiment = 3;

Returns
TypeDescription
Sentiment.Builder

getSentimentOrBuilder()

public SentimentOrBuilder getSentimentOrBuilder()

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

.google.cloud.language.v2.Sentiment sentiment = 3;

Returns
TypeDescription
SentimentOrBuilder

getText()

public TextSpan getText()

The mention text.

.google.cloud.language.v2.TextSpan text = 1;

Returns
TypeDescription
TextSpan

The text.

getTextBuilder()

public TextSpan.Builder getTextBuilder()

The mention text.

.google.cloud.language.v2.TextSpan text = 1;

Returns
TypeDescription
TextSpan.Builder

getTextOrBuilder()

public TextSpanOrBuilder getTextOrBuilder()

The mention text.

.google.cloud.language.v2.TextSpan text = 1;

Returns
TypeDescription
TextSpanOrBuilder

getType()

public EntityMention.Type getType()

The type of the entity mention.

.google.cloud.language.v2.EntityMention.Type type = 2;

Returns
TypeDescription
EntityMention.Type

The type.

getTypeValue()

public int getTypeValue()

The type of the entity mention.

.google.cloud.language.v2.EntityMention.Type type = 2;

Returns
TypeDescription
int

The enum numeric value on the wire for type.

hasSentiment()

public boolean hasSentiment()

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

.google.cloud.language.v2.Sentiment sentiment = 3;

Returns
TypeDescription
boolean

Whether the sentiment field is set.

hasText()

public boolean hasText()

The mention text.

.google.cloud.language.v2.TextSpan text = 1;

Returns
TypeDescription
boolean

Whether the text field is set.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

mergeFrom(EntityMention other)

public EntityMention.Builder mergeFrom(EntityMention other)
Parameter
NameDescription
otherEntityMention
Returns
TypeDescription
EntityMention.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public EntityMention.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
EntityMention.Builder
Overrides
Exceptions
TypeDescription
IOException

mergeFrom(Message other)

public EntityMention.Builder mergeFrom(Message other)
Parameter
NameDescription
otherMessage
Returns
TypeDescription
EntityMention.Builder
Overrides

mergeSentiment(Sentiment value)

public EntityMention.Builder mergeSentiment(Sentiment value)

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

.google.cloud.language.v2.Sentiment sentiment = 3;

Parameter
NameDescription
valueSentiment
Returns
TypeDescription
EntityMention.Builder

mergeText(TextSpan value)

public EntityMention.Builder mergeText(TextSpan value)

The mention text.

.google.cloud.language.v2.TextSpan text = 1;

Parameter
NameDescription
valueTextSpan
Returns
TypeDescription
EntityMention.Builder

mergeUnknownFields(UnknownFieldSet unknownFields)

public final EntityMention.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
EntityMention.Builder
Overrides

setField(Descriptors.FieldDescriptor field, Object value)

public EntityMention.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
EntityMention.Builder
Overrides

setProbability(float value)

public EntityMention.Builder setProbability(float value)

Probability score associated with the entity.

The score shows the probability of the entity mention being the entity type. The score is in (0, 1] range.

float probability = 4;

Parameter
NameDescription
valuefloat

The probability to set.

Returns
TypeDescription
EntityMention.Builder

This builder for chaining.

setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)

public EntityMention.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
NameDescription
fieldFieldDescriptor
indexint
valueObject
Returns
TypeDescription
EntityMention.Builder
Overrides

setSentiment(Sentiment value)

public EntityMention.Builder setSentiment(Sentiment value)

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

.google.cloud.language.v2.Sentiment sentiment = 3;

Parameter
NameDescription
valueSentiment
Returns
TypeDescription
EntityMention.Builder

setSentiment(Sentiment.Builder builderForValue)

public EntityMention.Builder setSentiment(Sentiment.Builder builderForValue)

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

.google.cloud.language.v2.Sentiment sentiment = 3;

Parameter
NameDescription
builderForValueSentiment.Builder
Returns
TypeDescription
EntityMention.Builder

setText(TextSpan value)

public EntityMention.Builder setText(TextSpan value)

The mention text.

.google.cloud.language.v2.TextSpan text = 1;

Parameter
NameDescription
valueTextSpan
Returns
TypeDescription
EntityMention.Builder

setText(TextSpan.Builder builderForValue)

public EntityMention.Builder setText(TextSpan.Builder builderForValue)

The mention text.

.google.cloud.language.v2.TextSpan text = 1;

Parameter
NameDescription
builderForValueTextSpan.Builder
Returns
TypeDescription
EntityMention.Builder

setType(EntityMention.Type value)

public EntityMention.Builder setType(EntityMention.Type value)

The type of the entity mention.

.google.cloud.language.v2.EntityMention.Type type = 2;

Parameter
NameDescription
valueEntityMention.Type

The type to set.

Returns
TypeDescription
EntityMention.Builder

This builder for chaining.

setTypeValue(int value)

public EntityMention.Builder setTypeValue(int value)

The type of the entity mention.

.google.cloud.language.v2.EntityMention.Type type = 2;

Parameter
NameDescription
valueint

The enum numeric value on the wire for type to set.

Returns
TypeDescription
EntityMention.Builder

This builder for chaining.

setUnknownFields(UnknownFieldSet unknownFields)

public final EntityMention.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
EntityMention.Builder
Overrides