#[non_exhaustive]pub struct EntityMention {
pub text: Option<TextSpan>,
pub type: Type,
pub sentiment: Option<Sentiment>,
pub probability: f32,
}Expand description
Represents a mention for an entity in the text. Currently, proper noun mentions are supported.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.text: Option<TextSpan>The mention text.
type: TypeThe type of the entity mention.
sentiment: Option<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.
probability: f32Probability 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.
Implementations§
Source§impl EntityMention
impl EntityMention
Sourcepub fn set_sentiment<T: Into<Option<Sentiment>>>(self, v: T) -> Self
pub fn set_sentiment<T: Into<Option<Sentiment>>>(self, v: T) -> Self
Sets the value of sentiment.
Sourcepub fn set_probability<T: Into<f32>>(self, v: T) -> Self
pub fn set_probability<T: Into<f32>>(self, v: T) -> Self
Sets the value of probability.
Trait Implementations§
Source§impl Clone for EntityMention
impl Clone for EntityMention
Source§fn clone(&self) -> EntityMention
fn clone(&self) -> EntityMention
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for EntityMention
impl Debug for EntityMention
Source§impl Default for EntityMention
impl Default for EntityMention
Source§fn default() -> EntityMention
fn default() -> EntityMention
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for EntityMentionwhere
EntityMention: Default,
impl<'de> Deserialize<'de> for EntityMentionwhere
EntityMention: Default,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Message for EntityMention
impl Message for EntityMention
Source§impl PartialEq for EntityMention
impl PartialEq for EntityMention
Source§impl Serialize for EntityMention
impl Serialize for EntityMention
impl StructuralPartialEq for EntityMention
Auto Trait Implementations§
impl Freeze for EntityMention
impl RefUnwindSafe for EntityMention
impl Send for EntityMention
impl Sync for EntityMention
impl Unpin for EntityMention
impl UnwindSafe for EntityMention
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more