(::Google::Cloud::Language::V2::Sentiment) — For calls to [AnalyzeEntitySentiment][] or if
[AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v2.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.
value (::Google::Cloud::Language::V2::Sentiment) — For calls to [AnalyzeEntitySentiment][] or if
[AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v2.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.
Returns
(::Google::Cloud::Language::V2::Sentiment) — For calls to [AnalyzeEntitySentiment][] or if
[AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v2.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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,["# Cloud Natural Language V2 API - Class Google::Cloud::Language::V2::EntityMention (v1.1.0)\n\nVersion latestkeyboard_arrow_down\n\n- [1.1.0 (latest)](/ruby/docs/reference/google-cloud-language-v2/latest/Google-Cloud-Language-V2-EntityMention)\n- [1.0.1](/ruby/docs/reference/google-cloud-language-v2/1.0.1/Google-Cloud-Language-V2-EntityMention)\n- [0.7.0](/ruby/docs/reference/google-cloud-language-v2/0.7.0/Google-Cloud-Language-V2-EntityMention)\n- [0.6.0](/ruby/docs/reference/google-cloud-language-v2/0.6.0/Google-Cloud-Language-V2-EntityMention)\n- [0.5.1](/ruby/docs/reference/google-cloud-language-v2/0.5.1/Google-Cloud-Language-V2-EntityMention)\n- [0.4.0](/ruby/docs/reference/google-cloud-language-v2/0.4.0/Google-Cloud-Language-V2-EntityMention)\n- [0.3.2](/ruby/docs/reference/google-cloud-language-v2/0.3.2/Google-Cloud-Language-V2-EntityMention)\n- [0.2.0](/ruby/docs/reference/google-cloud-language-v2/0.2.0/Google-Cloud-Language-V2-EntityMention)\n- [0.1.0](/ruby/docs/reference/google-cloud-language-v2/0.1.0/Google-Cloud-Language-V2-EntityMention) \nReference documentation and code samples for the Cloud Natural Language V2 API class Google::Cloud::Language::V2::EntityMention.\n\nRepresents a mention for an entity in the text. Currently, proper noun\nmentions are supported. \n\nInherits\n--------\n\n- Object \n\nExtended By\n-----------\n\n- Google::Protobuf::MessageExts::ClassMethods \n\nIncludes\n--------\n\n- Google::Protobuf::MessageExts\n\nMethods\n-------\n\n### #probability\n\n def probability() -\u003e ::Float\n\n**Returns**\n\n- (::Float) --- Probability score associated with the entity.\n\n The score shows the probability of the entity mention being the entity\n type. The score is in (0, 1\\] range.\n\n### #probability=\n\n def probability=(value) -\u003e ::Float\n\n**Parameter**\n\n- **value** (::Float) --- Probability score associated with the entity.\n\n\n The score shows the probability of the entity mention being the entity\ntype. The score is in (0, 1\\] range. \n**Returns**\n\n- (::Float) --- Probability score associated with the entity.\n\n The score shows the probability of the entity mention being the entity\n type. The score is in (0, 1\\] range.\n\n### #sentiment\n\n def sentiment() -\u003e ::Google::Cloud::Language::V2::Sentiment\n\n**Returns**\n\n- ([::Google::Cloud::Language::V2::Sentiment](./Google-Cloud-Language-V2-Sentiment)) --- For calls to \\[AnalyzeEntitySentiment\\]\\[\\] or if \\[AnnotateTextRequest.Features.extract_entity_sentiment\\]\\[google.cloud.language.v2.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.\n\n### #sentiment=\n\n def sentiment=(value) -\u003e ::Google::Cloud::Language::V2::Sentiment\n\n**Parameter**\n\n- **value** ([::Google::Cloud::Language::V2::Sentiment](./Google-Cloud-Language-V2-Sentiment)) --- For calls to \\[AnalyzeEntitySentiment\\]\\[\\] or if \\[AnnotateTextRequest.Features.extract_entity_sentiment\\]\\[google.cloud.language.v2.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. \n**Returns**\n\n- ([::Google::Cloud::Language::V2::Sentiment](./Google-Cloud-Language-V2-Sentiment)) --- For calls to \\[AnalyzeEntitySentiment\\]\\[\\] or if \\[AnnotateTextRequest.Features.extract_entity_sentiment\\]\\[google.cloud.language.v2.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.\n\n### #text\n\n def text() -\u003e ::Google::Cloud::Language::V2::TextSpan\n\n**Returns**\n\n- ([::Google::Cloud::Language::V2::TextSpan](./Google-Cloud-Language-V2-TextSpan)) --- The mention text.\n\n### #text=\n\n def text=(value) -\u003e ::Google::Cloud::Language::V2::TextSpan\n\n**Parameter**\n\n- **value** ([::Google::Cloud::Language::V2::TextSpan](./Google-Cloud-Language-V2-TextSpan)) --- The mention text. \n**Returns**\n\n- ([::Google::Cloud::Language::V2::TextSpan](./Google-Cloud-Language-V2-TextSpan)) --- The mention text.\n\n### #type\n\n def type() -\u003e ::Google::Cloud::Language::V2::EntityMention::Type\n\n**Returns**\n\n- ([::Google::Cloud::Language::V2::EntityMention::Type](./Google-Cloud-Language-V2-EntityMention-Type)) --- The type of the entity mention.\n\n### #type=\n\n def type=(value) -\u003e ::Google::Cloud::Language::V2::EntityMention::Type\n\n**Parameter**\n\n- **value** ([::Google::Cloud::Language::V2::EntityMention::Type](./Google-Cloud-Language-V2-EntityMention-Type)) --- The type of the entity mention. \n**Returns**\n\n- ([::Google::Cloud::Language::V2::EntityMention::Type](./Google-Cloud-Language-V2-EntityMention-Type)) --- The type of the entity mention."]]