Skip to main content

GraphCorefConfig

Struct GraphCorefConfig 

Source
pub struct GraphCorefConfig {
    pub max_iterations: usize,
    pub link_threshold: f64,
    pub transitivity_bonus: f64,
    pub per_shared_neighbor_bonus: f64,
    pub string_similarity_weight: f64,
    pub head_match_weight: f64,
    pub distance_weight: f64,
    pub max_distance: Option<usize>,
    pub include_singletons: bool,
    pub pronoun_proper_bonus: f64,
    pub early_stop: Option<GraphCorefEarlyStopConfig>,
}
Expand description

Configuration for graph-based coreference resolution.

These parameters control the iterative refinement process. The defaults are based on findings from Miculicich & Henderson (2022):

  • max_iterations = 4: Paper found T=4 optimal; more iterations don’t help
  • link_threshold = 0.5: Standard classification threshold
  • transitivity_bonus = 0.15: Reward for transitive consistency

§Tuning Guide

ParameterHigher ValueLower Value
link_thresholdFewer, more confident linksMore links, potential noise
transitivity_bonusStronger clustering effectMore independent decisions
max_iterationsMore refinement passesFaster, less propagation
head_match_weightTrust head matches moreRely more on full string

Fields§

§max_iterations: usize

Maximum refinement iterations before stopping.

The G2GT paper found T=4 to be optimal on CoNLL 2012. Fewer iterations leave potential coreference links undiscovered; more iterations don’t improve results and waste computation.

§link_threshold: f64

Minimum score to create a coreference link.

A pair (mᵢ, mⱼ) is linked if score(mᵢ, mⱼ) + context_bonus > threshold.

§transitivity_bonus: f64

Bonus added for transitive consistency.

If mentions A and B share neighbors in the current graph (i.e., both are already linked to some common mention C), this bonus is added to encourage the model to also link A and B directly.

Note: This is our heuristic approximation of G2GT’s graph-conditioned attention. The full G2GT model encodes graph structure as:

Attention(Q,K,V,Lk,Lv) = softmax(Q·(K+Lk)/√d)·(V+Lv)
where Lk = E(G^{t-1})·Wk

We approximate this by explicit score adjustment rather than attention modification.

§per_shared_neighbor_bonus: f64

Bonus for each shared neighbor.

Scaled by the number of shared neighbors: total_bonus = shared_count * per_neighbor_bonus

§string_similarity_weight: f64

Weight for string similarity in pairwise scoring.

§head_match_weight: f64

Weight for head word matching.

The G2GT paper emphasizes head-based matching. When mentions have head_start/head_end set, head matching is used. Otherwise falls back to last word heuristic.

§distance_weight: f64

Weight for distance penalty in pairwise scoring.

§max_distance: Option<usize>

Maximum character distance to consider (mentions further apart are not linked).

§include_singletons: bool

Include singletons (mentions with no coreference) in output.

Default: false (only return multi-mention chains). Set to true for evaluation against datasets that include singletons.

§pronoun_proper_bonus: f64

Bonus when a pronoun links to a proper noun.

Pronouns are weak signals alone but should link to antecedents.

§early_stop: Option<GraphCorefEarlyStopConfig>

Optional early-stop controls for iterative refinement.

GraphCoref already stops when it reaches a fixed point (Gₜ == Gₜ₋₁). This option additionally stops on:

  • Cycle detection (e.g., A→B→A oscillation across iterations)
  • Stagnation (edge count stops changing for N iterations)

This is an analogue of “overthinking” / redundancy detection (CoRE-Eval), implemented using observable signals (graph structure) rather than hidden states.

Trait Implementations§

Source§

impl Clone for GraphCorefConfig

Source§

fn clone(&self) -> GraphCorefConfig

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for GraphCorefConfig

Source§

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

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

impl Default for GraphCorefConfig

Source§

fn default() -> Self

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