Skip to main content

CorefConfig

Struct CorefConfig 

Source
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: usize

Maximum 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: bool

Enable 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: bool

Include singletons (entities with no coreferent) in output chains.

Default: true.

§use_name_gazetteer: bool

Use 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: bool

Enable 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: bool

Enable 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: bool

Enable 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: bool

Enable 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: bool

Enable 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: bool

Enable 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

Source§

fn clone(&self) -> CorefConfig

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for CorefConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Default for CorefConfig

Source§

fn default() -> CorefConfig

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more