pub struct Concept {
pub label: String,
pub concept_type: ConceptType,
pub confidence: f32,
pub description: Option<String>,
pub related: Vec<String>,
}Expand description
A concept extracted from text by an LLM.
Fields§
§label: StringThe concept label/name.
concept_type: ConceptTypeType of concept.
confidence: f32Confidence score (0.0-1.0).
description: Option<String>Optional description or definition.
Related concepts mentioned in the same context.
Implementations§
Source§impl Concept
impl Concept
Sourcepub fn with_type(self, concept_type: ConceptType) -> Self
pub fn with_type(self, concept_type: ConceptType) -> Self
Set the concept type.
Sourcepub fn with_confidence(self, confidence: f32) -> Self
pub fn with_confidence(self, confidence: f32) -> Self
Set the confidence score.
Sourcepub fn with_description(self, description: impl Into<String>) -> Self
pub fn with_description(self, description: impl Into<String>) -> Self
Set the description.
Add related concepts.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Concept
impl<'de> Deserialize<'de> for Concept
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
Auto Trait Implementations§
impl Freeze for Concept
impl RefUnwindSafe for Concept
impl Send for Concept
impl Sync for Concept
impl Unpin for Concept
impl UnwindSafe for Concept
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