pub struct LexiconNER { /* private fields */ }Expand description
NER backend that uses exact-match lexicon lookup.
Scans text for known entities from a lexicon/gazetteer. Best for closed-domain entities where the full list is known.
This is a library-only backend with no CLI entry point (--model lexicon
is not available). Use it programmatically via Pipeline
or directly through the Model trait.
Implementations§
Source§impl LexiconNER
impl LexiconNER
Sourcepub fn new(lexicon: impl Lexicon + 'static) -> LexiconNER
pub fn new(lexicon: impl Lexicon + 'static) -> LexiconNER
Create a new LexiconNER with the given lexicon.
Sourcepub fn with_case_sensitive(self, case_sensitive: bool) -> LexiconNER
pub fn with_case_sensitive(self, case_sensitive: bool) -> LexiconNER
Create with case-sensitive matching.
Sourcepub fn with_word_boundary(self, word_boundary: bool) -> LexiconNER
pub fn with_word_boundary(self, word_boundary: bool) -> LexiconNER
Create with word boundary requirement.
If true, only matches whole words (default).
If false, matches substrings (e.g., “Apple” matches in “AppleInc”).
Trait Implementations§
Source§impl Model for LexiconNER
impl Model for LexiconNER
Source§fn extract_entities(
&self,
text: &str,
language: Option<Language>,
) -> Result<Vec<Entity>, Error>
fn extract_entities( &self, text: &str, language: Option<Language>, ) -> Result<Vec<Entity>, Error>
Extract entities from text.
Source§fn supported_types(&self) -> Vec<EntityType>
fn supported_types(&self) -> Vec<EntityType>
Get supported entity types.
Source§fn is_available(&self) -> bool
fn is_available(&self) -> bool
Check if model is available and ready.
Source§fn description(&self) -> &'static str
fn description(&self) -> &'static str
Get a description of the model.
Source§fn capabilities(&self) -> ModelCapabilities
fn capabilities(&self) -> ModelCapabilities
Get capability summary for this model. Read more
Auto Trait Implementations§
impl Freeze for LexiconNER
impl !RefUnwindSafe for LexiconNER
impl Send for LexiconNER
impl Sync for LexiconNER
impl Unpin for LexiconNER
impl UnsafeUnpin for LexiconNER
impl !UnwindSafe for LexiconNER
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