pub struct PrivacyFilter { /* private fields */ }Implementations§
Source§impl PrivacyFilter
impl PrivacyFilter
pub fn spawn( server_executable: impl AsRef<Path>, model: impl AsRef<Path>, options: ServerOptions, ) -> Result<Self, Error>
Sourcepub fn spawn_fixed(
server_executable: impl AsRef<Path>,
model: impl AsRef<Path>,
options: ServerOptions,
fixed_trace: FixedTraceShape,
) -> Result<Self, Error>
pub fn spawn_fixed( server_executable: impl AsRef<Path>, model: impl AsRef<Path>, options: ServerOptions, fixed_trace: FixedTraceShape, ) -> Result<Self, Error>
Start the helper in single-shape mode so every Metal invocation uses the same exported trace, including padded rows in the final batch.
Sourcepub fn detect_batch(&mut self, texts: &[&str]) -> Result<Vec<Detection>, Error>
pub fn detect_batch(&mut self, texts: &[&str]) -> Result<Vec<Detection>, Error>
Tokenize and infer a batch. The native server automatically groups
documents by exported token bucket under max_batch_tokens and
restores the caller’s original order.
Sourcepub fn detect_chunked_batch(
&mut self,
texts: &[&str],
chunk_tokens: usize,
overlap_tokens: usize,
) -> Result<Vec<Detection>, Error>
pub fn detect_chunked_batch( &mut self, texts: &[&str], chunk_tokens: usize, overlap_tokens: usize, ) -> Result<Vec<Detection>, Error>
Preserve full-document semantics, refusing any input that would actually require chunking. The current exported model contract cannot reproduce full-sequence logits and Viterbi decoding across chunks.
Sourcepub fn detect_chunked_batch_approximate(
&mut self,
texts: &[&str],
chunk_tokens: usize,
overlap_tokens: usize,
) -> Result<Vec<Detection>, Error>
pub fn detect_chunked_batch_approximate( &mut self, texts: &[&str], chunk_tokens: usize, overlap_tokens: usize, ) -> Result<Vec<Detection>, Error>
Run overlapping chunks and merge their independently decoded spans. This is intentionally explicit because boundary logits and Viterbi paths can differ from a full-document inference.
pub fn detect(&mut self, text: &str) -> Result<Detection, Error>
Trait Implementations§
Source§impl Drop for PrivacyFilter
impl Drop for PrivacyFilter
Auto Trait Implementations§
impl Freeze for PrivacyFilter
impl RefUnwindSafe for PrivacyFilter
impl Send for PrivacyFilter
impl Sync for PrivacyFilter
impl Unpin for PrivacyFilter
impl UnsafeUnpin for PrivacyFilter
impl UnwindSafe for PrivacyFilter
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> 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