pub struct CorefLinkFactor {
pub mention_i: usize,
pub mention_j: usize,
pub weights: CorefLinkWeights,
/* private fields */
}Expand description
Factor coupling coreference and entity linking.
Encourages coreferent mentions to link to related Wikipedia articles. Only fires when mention i is linked to mention j (a_i = j).
§Features
- Same title: e_i = e_j (same article)
- Shared outlinks: articles share outgoing links
- Mutual links: one article links to the other
§Example
If “the company” → “Dell” is a coref link:
- e(“Dell”) = Dell (company article)
- e(“the company”) = Dell (should link to same)
- Factor: high score for same entity
Fields§
§mention_i: usizeCurrent mention index (i)
mention_j: usizeAntecedent mention index (j)
weights: CorefLinkWeightsWeights
Implementations§
Source§impl CorefLinkFactor
impl CorefLinkFactor
Sourcepub fn new(
mention_i: usize,
mention_j: usize,
weights: CorefLinkWeights,
) -> Self
pub fn new( mention_i: usize, mention_j: usize, weights: CorefLinkWeights, ) -> Self
Create a new Coref+Link factor.
Sourcepub fn with_knowledge(self, knowledge: Arc<WikipediaKnowledgeStore>) -> Self
pub fn with_knowledge(self, knowledge: Arc<WikipediaKnowledgeStore>) -> Self
Set knowledge store.
Trait Implementations§
Source§impl Clone for CorefLinkFactor
impl Clone for CorefLinkFactor
Source§fn clone(&self) -> CorefLinkFactor
fn clone(&self) -> CorefLinkFactor
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 Debug for CorefLinkFactor
impl Debug for CorefLinkFactor
Source§impl Factor for CorefLinkFactor
impl Factor for CorefLinkFactor
Source§fn scope(&self) -> &[VariableId]
fn scope(&self) -> &[VariableId]
The variables this factor touches (its “scope”). Read more
Source§fn log_potential(&self, assignment: &Assignment) -> f64
fn log_potential(&self, assignment: &Assignment) -> f64
Log potential (unnormalized log probability) for an assignment. Read more
Auto Trait Implementations§
impl Freeze for CorefLinkFactor
impl RefUnwindSafe for CorefLinkFactor
impl Send for CorefLinkFactor
impl Sync for CorefLinkFactor
impl Unpin for CorefLinkFactor
impl UnsafeUnpin for CorefLinkFactor
impl UnwindSafe for CorefLinkFactor
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