pub struct ExtractionResult {
pub entities: Vec<ExtractedEntity>,
pub relations: Vec<ExtractedRelation>,
pub raw_text: String,
}Expand description
Result of entity extraction from text.
Contains extracted entities, relations, and the original text.
Fields§
§entities: Vec<ExtractedEntity>Extracted entities
relations: Vec<ExtractedRelation>Extracted relations
raw_text: StringOriginal input text
Implementations§
Source§impl ExtractionResult
impl ExtractionResult
Sourcepub fn new(
entities: Vec<ExtractedEntity>,
relations: Vec<ExtractedRelation>,
raw_text: impl Into<String>,
) -> Self
pub fn new( entities: Vec<ExtractedEntity>, relations: Vec<ExtractedRelation>, raw_text: impl Into<String>, ) -> Self
Create a new extraction result.
Sourcepub fn empty(raw_text: impl Into<String>) -> Self
pub fn empty(raw_text: impl Into<String>) -> Self
Create an empty result (no entities or relations).
Sourcepub fn entity_count(&self) -> usize
pub fn entity_count(&self) -> usize
Get the number of entities.
Sourcepub fn relation_count(&self) -> usize
pub fn relation_count(&self) -> usize
Get the number of relations.
Sourcepub fn entities_of_type(&self, entity_type: EntityType) -> Vec<&ExtractedEntity>
pub fn entities_of_type(&self, entity_type: EntityType) -> Vec<&ExtractedEntity>
Get entities filtered by type.
Sourcepub fn entities_above_confidence(
&self,
min_confidence: f64,
) -> Vec<&ExtractedEntity>
pub fn entities_above_confidence( &self, min_confidence: f64, ) -> Vec<&ExtractedEntity>
Get entities with confidence above threshold.
Trait Implementations§
Source§impl Clone for ExtractionResult
impl Clone for ExtractionResult
Source§fn clone(&self) -> ExtractionResult
fn clone(&self) -> ExtractionResult
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 ExtractionResult
impl Debug for ExtractionResult
Source§impl PartialEq for ExtractionResult
impl PartialEq for ExtractionResult
impl StructuralPartialEq for ExtractionResult
Auto Trait Implementations§
impl Freeze for ExtractionResult
impl RefUnwindSafe for ExtractionResult
impl Send for ExtractionResult
impl Sync for ExtractionResult
impl Unpin for ExtractionResult
impl UnwindSafe for ExtractionResult
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