narrative-graph 0.1.2

Turn prose into candidate relational facts — entity detection, relation labeling, confidence scoring, entirely local.
Documentation
use std::fmt;

#[derive(Debug)]
pub enum NarrativeGraphError {
    InvalidConfidenceThreshold(f32),
}

impl fmt::Display for NarrativeGraphError {
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        match self {
            NarrativeGraphError::InvalidConfidenceThreshold(value) => write!(
                f,
                "Confidence threshold must be between 0.0 and 1.0, got {value}"
            ),
        }
    }
}

impl std::error::Error for NarrativeGraphError {}

pub type Result<T> = std::result::Result<T, NarrativeGraphError>;