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 helplink_threshold = 0.5: Standard classification thresholdtransitivity_bonus = 0.15: Reward for transitive consistency
§Tuning Guide
| Parameter | Higher Value | Lower Value |
|---|---|---|
link_threshold | Fewer, more confident links | More links, potential noise |
transitivity_bonus | Stronger clustering effect | More independent decisions |
max_iterations | More refinement passes | Faster, less propagation |
head_match_weight | Trust head matches more | Rely more on full string |
Fields§
§max_iterations: usizeMaximum 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: f64Minimum score to create a coreference link.
A pair (mᵢ, mⱼ) is linked if score(mᵢ, mⱼ) + context_bonus > threshold.
transitivity_bonus: f64Bonus 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})·WkWe approximate this by explicit score adjustment rather than attention modification.
Bonus for each shared neighbor.
Scaled by the number of shared neighbors: total_bonus = shared_count * per_neighbor_bonus
string_similarity_weight: f64Weight for string similarity in pairwise scoring.
head_match_weight: f64Weight 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: f64Weight for distance penalty in pairwise scoring.
max_distance: Option<usize>Maximum character distance to consider (mentions further apart are not linked).
include_singletons: boolInclude 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: f64Bonus 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
impl Clone for GraphCorefConfig
Source§fn clone(&self) -> GraphCorefConfig
fn clone(&self) -> GraphCorefConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for GraphCorefConfig
impl Debug for GraphCorefConfig
Auto Trait Implementations§
impl Freeze for GraphCorefConfig
impl RefUnwindSafe for GraphCorefConfig
impl Send for GraphCorefConfig
impl Sync for GraphCorefConfig
impl Unpin for GraphCorefConfig
impl UnsafeUnpin for GraphCorefConfig
impl UnwindSafe for GraphCorefConfig
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,
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