pub struct EntityClassifier { /* private fields */ }Expand description
Entity classifier using heuristic rules and optional user-defined rules.
Implementations§
Source§impl EntityClassifier
impl EntityClassifier
Sourcepub fn add_rule(&mut self, rule: ClassificationRule)
pub fn add_rule(&mut self, rule: ClassificationRule)
Add a user-defined classification rule.
Sourcepub fn rule_count(&self) -> usize
pub fn rule_count(&self) -> usize
Return the number of user-defined rules.
Sourcepub fn classify(&self, text: &str) -> ClassificationResult
pub fn classify(&self, text: &str) -> ClassificationResult
Classify a single entity text string.
Sourcepub fn classify_batch(&self, texts: &[&str]) -> Vec<ClassificationResult>
pub fn classify_batch(&self, texts: &[&str]) -> Vec<ClassificationResult>
Classify a batch of entity text strings.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for EntityClassifier
impl RefUnwindSafe for EntityClassifier
impl Send for EntityClassifier
impl Sync for EntityClassifier
impl Unpin for EntityClassifier
impl UnsafeUnpin for EntityClassifier
impl UnwindSafe for EntityClassifier
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