Skip to main content

InferenceEngine

Struct InferenceEngine 

Source
pub struct InferenceEngine { /* private fields */ }

Implementations§

Source§

impl InferenceEngine

Source

pub fn new(lexicon: Lexicon) -> Self

Construit l’engine depuis un Lexicon déjà chargé.

Source

pub fn from_dir(path: &Path) -> Result<Self, KnowledgeError>

Construit l’engine en chargeant les taxonomies depuis un répertoire.

Source

pub fn infer_node_type(&self, lemma: &str, pos: &str) -> Option<NodeType>

Infère le NodeType d’un lemme depuis les taxonomies.

Retourne None si le POS est hors périmètre (ex : auxiliaire) ou si le lemme est inconnu.

Source

pub fn infer_scope(&self, lemma: &str, pos: &str) -> Option<Scope>

Infère le Scope d’un token DET ou PRON depuis les taxonomies.

À appeler au moment du parse, quand le token est connu. L’annotation explicite scope de l’entrée lexicale a priorité sur le fallback par nom de classe.

Source

pub fn score_confidence( &self, from: NodeType, to: NodeType, rel: RelationType, explicit: bool, ) -> f32

Score de confiance structurel basé sur la compatibilité des types.

Base : 1.0 si arête explicite, 0.5 sinon. Un bonus/malus est appliqué selon la combinaison (from, to, relation). Résultat clampé dans [0.1, 1.0].

Source

pub fn enrich(&self, ir: &mut CausalIR) -> Vec<InferenceNote>

Enrichit un CausalIR en 3 passes borrow-safe et retourne les notes produites.

  • Passe 1 : résolution des types de nœuds avec origin == Inferred via attributes.entity (lookup NOUN dans les taxonomies).
  • Passe 2 : snapshot NodeId → NodeType post-passe 1.
  • Passe 3 : recalibrage de confiance des arêtes implicites ; signalement des lacunes causales (Concession / Opposition).

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.