pub struct EntityLinkerProvider { /* private fields */ }Expand description
A LinkScoreProvider that uses the existing EntityLinker infrastructure.
This adapter bridges the joint model with anno’s entity linking system.
§Example
ⓘ
use anno::joint::{JointModelBuilder, EntityLinkerProvider};
use anno::linking::EntityLinker;
use std::sync::Arc;
let linker = EntityLinker::builder()
.with_max_candidates(20)
.build()?;
let provider = EntityLinkerProvider::new(Arc::new(linker));Implementations§
Source§impl EntityLinkerProvider
impl EntityLinkerProvider
Sourcepub fn new(linker: Arc<EntityLinker>) -> Self
pub fn new(linker: Arc<EntityLinker>) -> Self
Create a new provider wrapping an entity linker.
Sourcepub fn with_max_candidates(self, max: usize) -> Self
pub fn with_max_candidates(self, max: usize) -> Self
Set maximum candidates to return.
Trait Implementations§
Source§impl LinkScoreProvider for EntityLinkerProvider
impl LinkScoreProvider for EntityLinkerProvider
Source§fn link_candidates(
&self,
mention: &JointMention,
text: &str,
) -> Vec<(String, f64)>
fn link_candidates( &self, mention: &JointMention, text: &str, ) -> Vec<(String, f64)>
Get link candidates for a mention. Read more
Auto Trait Implementations§
impl Freeze for EntityLinkerProvider
impl !RefUnwindSafe for EntityLinkerProvider
impl Send for EntityLinkerProvider
impl Sync for EntityLinkerProvider
impl Unpin for EntityLinkerProvider
impl UnsafeUnpin for EntityLinkerProvider
impl !UnwindSafe for EntityLinkerProvider
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