pub struct JointModelBuilder { /* private fields */ }Expand description
Builder for JointModel with fluent configuration.
§Example
ⓘ
use anno::joint::{JointModelBuilder, WikipediaKnowledgeStore};
let model = JointModelBuilder::new()
.with_max_iterations(10)
.with_convergence_threshold(1e-5)
.enable_link_ner(true)
.enable_coref_ner(true)
.enable_coref_link(true)
.with_knowledge(knowledge_store)
.build()?;Implementations§
Source§impl JointModelBuilder
impl JointModelBuilder
Sourcepub fn with_max_iterations(self, max_iterations: usize) -> Self
pub fn with_max_iterations(self, max_iterations: usize) -> Self
Set maximum iterations for belief propagation.
Sourcepub fn with_convergence_threshold(self, threshold: f64) -> Self
pub fn with_convergence_threshold(self, threshold: f64) -> Self
Set convergence threshold for belief propagation.
Sourcepub fn with_pruning_threshold(self, threshold: f64) -> Self
pub fn with_pruning_threshold(self, threshold: f64) -> Self
Set pruning threshold for antecedent candidates.
Sourcepub fn with_max_antecedent_candidates(self, max: usize) -> Self
pub fn with_max_antecedent_candidates(self, max: usize) -> Self
Set maximum antecedent candidates to keep after pruning.
Sourcepub fn with_max_link_candidates(self, max: usize) -> Self
pub fn with_max_link_candidates(self, max: usize) -> Self
Set maximum link candidates per mention.
Sourcepub fn enable_link_ner(self, enable: bool) -> Self
pub fn enable_link_ner(self, enable: bool) -> Self
Enable or disable Link+NER factors.
Sourcepub fn enable_coref_ner(self, enable: bool) -> Self
pub fn enable_coref_ner(self, enable: bool) -> Self
Enable or disable Coref+NER factors.
Sourcepub fn enable_coref_link(self, enable: bool) -> Self
pub fn enable_coref_link(self, enable: bool) -> Self
Enable or disable Coref+Link factors.
Sourcepub fn with_entity_types(self, types: Vec<EntityType>) -> Self
pub fn with_entity_types(self, types: Vec<EntityType>) -> Self
Set entity types to consider.
Sourcepub fn with_knowledge(self, store: Arc<WikipediaKnowledgeStore>) -> Self
pub fn with_knowledge(self, store: Arc<WikipediaKnowledgeStore>) -> Self
Add Wikipedia knowledge store for semantics lookups.
Sourcepub fn with_ner_provider(self, provider: Arc<dyn NerScoreProvider>) -> Self
pub fn with_ner_provider(self, provider: Arc<dyn NerScoreProvider>) -> Self
Plug in a custom NER score provider (unary NER factors).
Sourcepub fn with_coref_provider(self, provider: Arc<dyn CorefScoreProvider>) -> Self
pub fn with_coref_provider(self, provider: Arc<dyn CorefScoreProvider>) -> Self
Plug in a custom coreference score provider (unary coref factors).
Sourcepub fn with_link_provider(self, provider: Arc<dyn LinkScoreProvider>) -> Self
pub fn with_link_provider(self, provider: Arc<dyn LinkScoreProvider>) -> Self
Plug in a custom link score provider (unary link factors).
Sourcepub fn build(self) -> Result<JointModel>
pub fn build(self) -> Result<JointModel>
Build the JointModel.
Trait Implementations§
Source§impl Clone for JointModelBuilder
impl Clone for JointModelBuilder
Source§fn clone(&self) -> JointModelBuilder
fn clone(&self) -> JointModelBuilder
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Default for JointModelBuilder
impl Default for JointModelBuilder
Source§fn default() -> JointModelBuilder
fn default() -> JointModelBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for JointModelBuilder
impl !RefUnwindSafe for JointModelBuilder
impl Send for JointModelBuilder
impl Sync for JointModelBuilder
impl Unpin for JointModelBuilder
impl UnsafeUnpin for JointModelBuilder
impl !UnwindSafe for JointModelBuilder
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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