pub struct ExtractedRelation {
pub source: String,
pub target: String,
pub relation_type: RelationType,
pub confidence: f64,
}Expand description
Relation between two entities extracted from text.
TigerStyle: Immutable after creation, validated on construction.
Fields§
§source: StringSource entity name
target: StringTarget entity name
relation_type: RelationTypeType of relation
confidence: f64Extraction confidence (0.0-1.0)
Implementations§
Source§impl ExtractedRelation
impl ExtractedRelation
Sourcepub fn new(
source: impl Into<String>,
target: impl Into<String>,
relation_type: RelationType,
confidence: f64,
) -> Self
pub fn new( source: impl Into<String>, target: impl Into<String>, relation_type: RelationType, confidence: f64, ) -> Self
Create a new extracted relation with validation.
§Panics
Panics if source/target are empty or confidence is out of range.
Sourcepub fn with_default_confidence(
source: impl Into<String>,
target: impl Into<String>,
relation_type: RelationType,
) -> Self
pub fn with_default_confidence( source: impl Into<String>, target: impl Into<String>, relation_type: RelationType, ) -> Self
Create a new relation with default confidence.
Sourcepub fn is_high_confidence(&self) -> bool
pub fn is_high_confidence(&self) -> bool
Check if this is a high confidence extraction (>= 0.8).
Trait Implementations§
Source§impl Clone for ExtractedRelation
impl Clone for ExtractedRelation
Source§fn clone(&self) -> ExtractedRelation
fn clone(&self) -> ExtractedRelation
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 ExtractedRelation
impl Debug for ExtractedRelation
Source§impl<'de> Deserialize<'de> for ExtractedRelation
impl<'de> Deserialize<'de> for ExtractedRelation
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 PartialEq for ExtractedRelation
impl PartialEq for ExtractedRelation
Source§impl Serialize for ExtractedRelation
impl Serialize for ExtractedRelation
impl StructuralPartialEq for ExtractedRelation
Auto Trait Implementations§
impl Freeze for ExtractedRelation
impl RefUnwindSafe for ExtractedRelation
impl Send for ExtractedRelation
impl Sync for ExtractedRelation
impl Unpin for ExtractedRelation
impl UnwindSafe for ExtractedRelation
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