pub struct CorefConfig {
pub max_pronoun_lookback: usize,
pub fuzzy_matching: bool,
pub include_singletons: bool,
pub use_name_gazetteer: bool,
pub acronym_matching: bool,
pub relaxed_head_match: bool,
pub proper_containment: bool,
pub precise_constructs: bool,
pub strict_head_match: bool,
pub proper_head_word_match: bool,
}Expand description
Configuration for SimpleCorefResolver.
All boolean sieve toggles default to true. Disable individual sieves to measure their
contribution or to reduce false merges on a particular dataset.
Fields§
§max_pronoun_lookback: usizeMaximum number of preceding entities to search when resolving a pronoun (sieve 1).
The actual lookback window is max_pronoun_lookback * 10 entities,
a rough approximation of sentence distance by entity count.
Default: 3 (i.e., 30 entities).
fuzzy_matching: boolEnable substring/fuzzy name matching (sieve 6).
When enabled, two mentions match if one is a substring of the other (>= 3 chars) or if they share a last word and entity type.
Default: true.
include_singletons: boolInclude singletons (entities with no coreferent) in output chains.
Default: true.
use_name_gazetteer: boolUse a built-in name-to-gender gazetteer for pronoun resolution (sieve 1).
When enabled, common English names (e.g., “Alice” -> Feminine, “Bob” -> Masculine) are used to infer gender for proper nouns, improving pronoun resolution accuracy. Disable for non-English text or when names don’t follow English gender conventions.
Default: true.
acronym_matching: boolEnable acronym matching (sieve 3).
Checks if one mention is a single-token acronym whose letters match the initial letters of the other mention’s words. Requires same entity type. Example: “IBM” matches “International Business Machines”.
Default: true.
relaxed_head_match: boolEnable relaxed head match (sieve 4).
Two mentions corefer if their head words (last word) match and they share the same entity type. Only applies when both mentions have 2+ words. Example: “President Obama” ~ “Barack Obama” via shared head “Obama”.
Default: true.
proper_containment: boolEnable proper noun containment (sieve 8).
One mention’s original text must be a proper subsequence of the other, matching at word boundaries, and both must share the same entity type. Unlike sieve 9 (fuzzy/substring), this operates on original text (not canonical lowercased form) and requires complete word-boundary alignment. Example: “Obama” is contained in “Barack Obama”.
Default: true.
precise_constructs: boolEnable precise constructs sieve (sieve 3).
Detects appositive constructions where two entity mentions are immediately adjacent (gap <= 2 characters, allowing for “, “) with compatible entity types. E.g., “Barack Obama, the president” – merges the two NPs.
Default: true.
strict_head_match: boolEnable strict head matching (sieve 5).
Two mentions match if they share the same head word (last word), have compatible entity types and gender, and do not violate the i-within-i constraint (one mention’s span must not contain the other’s span).
Default: true.
proper_head_word_match: boolEnable proper head word matching (sieve 6).
For named entity mentions: the head word (last word) of one mention appears as any word in the other mention, with same entity type required. E.g., “President Obama” matches “Barack Hussein Obama” (head “Obama” found in both).
Default: true.
Trait Implementations§
Source§impl Clone for CorefConfig
impl Clone for CorefConfig
Source§fn clone(&self) -> CorefConfig
fn clone(&self) -> CorefConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CorefConfig
impl Debug for CorefConfig
Source§impl Default for CorefConfig
impl Default for CorefConfig
Source§fn default() -> CorefConfig
fn default() -> CorefConfig
Auto Trait Implementations§
impl Freeze for CorefConfig
impl RefUnwindSafe for CorefConfig
impl Send for CorefConfig
impl Sync for CorefConfig
impl Unpin for CorefConfig
impl UnsafeUnpin for CorefConfig
impl UnwindSafe for CorefConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
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>
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>
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