pub enum DocumentScale {
Short,
Medium,
Long,
BookScale,
}Expand description
Document scale classification based on token count.
§Research Context (Bourgois & Poibeau 2025, arXiv:2510.15594)
The paper shows that coreference performance degrades significantly with document length. These thresholds are informed by their analysis:
Scale Token Range Performance Impact
─────────────────────────────────────────────────────
Short <2k Baseline (OntoNotes-like)
Medium 2k-10k -5% CoNLL F1
Long 10k-50k -10% CoNLL F1
BookScale >50k -15% CoNLL F1, metrics unreliable§Example
use anno_eval::eval::DocumentScale;
let scale = DocumentScale::from_tokens(95_000);
assert!(scale.is_book_scale());
assert!(scale.metrics_may_be_unreliable());Variants§
Short
Short document (<2k tokens). OntoNotes-like scale.
Medium
Medium document (2k-10k tokens). Slight performance drop.
Long
Long document (10k-50k tokens). Noticeable degradation.
BookScale
Book-scale document (>50k tokens). Metrics may be unreliable.
Implementations§
Source§impl DocumentScale
impl DocumentScale
Sourcepub fn from_tokens(token_count: usize) -> Self
pub fn from_tokens(token_count: usize) -> Self
Classify document scale from token count.
Sourcepub fn is_book_scale(&self) -> bool
pub fn is_book_scale(&self) -> bool
Check if this is book-scale (>50k tokens).
Sourcepub fn metrics_may_be_unreliable(&self) -> bool
pub fn metrics_may_be_unreliable(&self) -> bool
Check if coreference metrics may be unreliable at this scale.
At book scale, MUC tends to inflate while CEAF-e tends to collapse.
Sourcepub fn expected_degradation(&self) -> f64
pub fn expected_degradation(&self) -> f64
Get expected CoNLL F1 degradation relative to short documents.
Trait Implementations§
Source§impl Clone for DocumentScale
impl Clone for DocumentScale
Source§fn clone(&self) -> DocumentScale
fn clone(&self) -> DocumentScale
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for DocumentScale
Source§impl Debug for DocumentScale
impl Debug for DocumentScale
Source§impl Default for DocumentScale
impl Default for DocumentScale
Source§fn default() -> DocumentScale
fn default() -> DocumentScale
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for DocumentScale
impl<'de> Deserialize<'de> for DocumentScale
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for DocumentScale
impl Display for DocumentScale
impl Eq for DocumentScale
Source§impl PartialEq for DocumentScale
impl PartialEq for DocumentScale
Source§fn eq(&self, other: &DocumentScale) -> bool
fn eq(&self, other: &DocumentScale) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for DocumentScale
impl Serialize for DocumentScale
impl StructuralPartialEq for DocumentScale
Auto Trait Implementations§
impl Freeze for DocumentScale
impl RefUnwindSafe for DocumentScale
impl Send for DocumentScale
impl Sync for DocumentScale
impl Unpin for DocumentScale
impl UnsafeUnpin for DocumentScale
impl UnwindSafe for DocumentScale
Blanket Implementations§
impl<T> Boilerplate for T
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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>
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
Fallible version of
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
Converts the given value to a
CompactString. Read moreSource§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.