pub struct ConfusableEntity {
pub kb_id: String,
pub label: String,
pub description: Option<String>,
pub reason: ConfusableReason,
pub entity_type: Option<String>,
pub difficulty: f64,
}Expand description
A confusable entity candidate (hard negative).
Fields§
§kb_id: StringKnowledge base ID
label: StringCanonical label
description: Option<String>Short description to distinguish
reason: ConfusableReasonWhy this is confusable
entity_type: Option<String>Type information (human, organization, etc.)
difficulty: f64Difficulty score (0-1, higher = harder to distinguish)
Implementations§
Source§impl ConfusableEntity
impl ConfusableEntity
Sourcepub fn new(kb_id: &str, reason: ConfusableReason) -> ConfusableEntity
pub fn new(kb_id: &str, reason: ConfusableReason) -> ConfusableEntity
Create a new confusable entity.
Sourcepub fn with_label(self, label: &str) -> ConfusableEntity
pub fn with_label(self, label: &str) -> ConfusableEntity
Set label.
Sourcepub fn with_description(self, desc: &str) -> ConfusableEntity
pub fn with_description(self, desc: &str) -> ConfusableEntity
Set description.
Sourcepub fn with_entity_type(self, entity_type: &str) -> ConfusableEntity
pub fn with_entity_type(self, entity_type: &str) -> ConfusableEntity
Set entity type.
Sourcepub fn with_difficulty(self, difficulty: f64) -> ConfusableEntity
pub fn with_difficulty(self, difficulty: f64) -> ConfusableEntity
Set difficulty.
Trait Implementations§
Source§impl Clone for ConfusableEntity
impl Clone for ConfusableEntity
Source§fn clone(&self) -> ConfusableEntity
fn clone(&self) -> ConfusableEntity
Returns a duplicate 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 ConfusableEntity
impl Debug for ConfusableEntity
Source§impl<'de> Deserialize<'de> for ConfusableEntity
impl<'de> Deserialize<'de> for ConfusableEntity
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ConfusableEntity, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ConfusableEntity, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for ConfusableEntity
impl Serialize for ConfusableEntity
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for ConfusableEntity
impl RefUnwindSafe for ConfusableEntity
impl Send for ConfusableEntity
impl Sync for ConfusableEntity
impl Unpin for ConfusableEntity
impl UnsafeUnpin for ConfusableEntity
impl UnwindSafe for ConfusableEntity
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more