pub struct CustomNER { /* private fields */ }Expand description
Custom NER model
Implementations§
Source§impl CustomNER
impl CustomNER
Sourcepub fn register_entity_type(&mut self, entity_type: EntityType)
pub fn register_entity_type(&mut self, entity_type: EntityType)
Register entity type
Sourcepub fn add_rule(&mut self, rule: ExtractionRule)
pub fn add_rule(&mut self, rule: ExtractionRule)
Add extraction rule
Sourcepub fn extract(&self, text: &str) -> Vec<ExtractedEntity>
pub fn extract(&self, text: &str) -> Vec<ExtractedEntity>
Extract entities from text
Sourcepub fn entity_types(&self) -> &HashMap<String, EntityType>
pub fn entity_types(&self) -> &HashMap<String, EntityType>
Get entity types
Sourcepub fn rules(&self) -> &[ExtractionRule]
pub fn rules(&self) -> &[ExtractionRule]
Get rules
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CustomNER
impl RefUnwindSafe for CustomNER
impl Send for CustomNER
impl Sync for CustomNER
impl Unpin for CustomNER
impl UnsafeUnpin for CustomNER
impl UnwindSafe for CustomNER
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