pub struct GleaningEntityExtractor { /* private fields */ }Expand description
Entity extractor with iterative gleaning refinement using TRUE LLM calls
This is the REAL implementation that makes actual LLM API calls for every extraction. It replaces the fake pattern-based extraction with genuine language model inference.
Implementations§
Source§impl GleaningEntityExtractor
impl GleaningEntityExtractor
Sourcepub fn new(ollama_client: OllamaClient, config: GleaningConfig) -> Self
pub fn new(ollama_client: OllamaClient, config: GleaningConfig) -> Self
Create a new gleaning entity extractor with LLM client
§Arguments
ollama_client- Ollama client for LLM inference (REQUIRED)config- Gleaning configuration
Sourcepub async fn extract_with_gleaning(
&self,
chunk: &TextChunk,
) -> Result<(Vec<Entity>, Vec<Relationship>)>
pub async fn extract_with_gleaning( &self, chunk: &TextChunk, ) -> Result<(Vec<Entity>, Vec<Relationship>)>
Extract entities with iterative refinement (gleaning) using TRUE LLM calls
This is the REAL implementation that makes actual LLM API calls. Expected time: 15-30 seconds per round = 60-120 seconds total for 4 rounds per chunk.
§Performance
- 1 chunk, 4 rounds: ~2 minutes
- 100 chunks, 4 rounds: ~3-4 hours
- Tom Sawyer (1000 pages): ~2-4 hours
Sourcepub fn get_statistics(&self) -> GleaningStatistics
pub fn get_statistics(&self) -> GleaningStatistics
Get extraction statistics
Auto Trait Implementations§
impl Freeze for GleaningEntityExtractor
impl !RefUnwindSafe for GleaningEntityExtractor
impl Send for GleaningEntityExtractor
impl Sync for GleaningEntityExtractor
impl Unpin for GleaningEntityExtractor
impl UnsafeUnpin for GleaningEntityExtractor
impl !UnwindSafe for GleaningEntityExtractor
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> 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