pub struct TPLinker { /* private fields */ }Expand description
TPLinker backend for joint entity-relation extraction.
When the onnx feature is enabled and a model has been loaded, uses real
neural handshaking matrix decoding. Otherwise falls back to a heuristic
baseline using StackedNER + trigger matching.
Implementations§
Source§impl TPLinker
impl TPLinker
Sourcepub fn new() -> Result<TPLinker, Error>
pub fn new() -> Result<TPLinker, Error>
Create a new TPLinker instance.
Attempts to load the ONNX model from the default cache directory. Falls back to heuristic mode if the model is not available.
Sourcepub fn with_thresholds(
entity_threshold: f32,
relation_threshold: f32,
) -> TPLinker
pub fn with_thresholds( entity_threshold: f32, relation_threshold: f32, ) -> TPLinker
Create with custom thresholds.
Trait Implementations§
Source§impl Model for TPLinker
impl Model for TPLinker
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
Source§impl RelationCapable for TPLinker
impl RelationCapable for TPLinker
Source§impl RelationExtractor for TPLinker
impl RelationExtractor for TPLinker
Auto Trait Implementations§
impl !Freeze for TPLinker
impl RefUnwindSafe for TPLinker
impl Send for TPLinker
impl Sync for TPLinker
impl Unpin for TPLinker
impl UnsafeUnpin for TPLinker
impl UnwindSafe for TPLinker
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