pub struct Annotator { /* private fields */ }
Expand description
Main annotator for processing text through language models
Implementations§
Source§impl Annotator
impl Annotator
Sourcepub fn new(
language_model: Box<dyn BaseLanguageModel>,
prompt_template: PromptTemplateStructured,
format_type: FormatType,
fence_output: bool,
) -> Self
pub fn new( language_model: Box<dyn BaseLanguageModel>, prompt_template: PromptTemplateStructured, format_type: FormatType, fence_output: bool, ) -> Self
Create a new annotator
Sourcepub async fn annotate_text(
&self,
text: &str,
resolver: &Resolver,
max_char_buffer: usize,
batch_length: usize,
additional_context: Option<&str>,
debug: bool,
extraction_passes: usize,
max_workers: usize,
) -> LangExtractResult<AnnotatedDocument>
pub async fn annotate_text( &self, text: &str, resolver: &Resolver, max_char_buffer: usize, batch_length: usize, additional_context: Option<&str>, debug: bool, extraction_passes: usize, max_workers: usize, ) -> LangExtractResult<AnnotatedDocument>
Annotate text and return annotated document
Auto Trait Implementations§
impl Freeze for Annotator
impl !RefUnwindSafe for Annotator
impl Send for Annotator
impl Sync for Annotator
impl Unpin for Annotator
impl !UnwindSafe for Annotator
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