pub struct InferenceEngine { /* private fields */ }Implementations§
Source§impl InferenceEngine
impl InferenceEngine
Sourcepub fn from_dir(path: &Path) -> Result<Self, KnowledgeError>
pub fn from_dir(path: &Path) -> Result<Self, KnowledgeError>
Construit l’engine en chargeant les taxonomies depuis un répertoire.
Sourcepub fn infer_node_type(&self, lemma: &str, pos: &str) -> Option<NodeType>
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.
Sourcepub fn infer_scope(&self, lemma: &str, pos: &str) -> Option<Scope>
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.
Sourcepub fn score_confidence(
&self,
from: NodeType,
to: NodeType,
rel: RelationType,
explicit: bool,
) -> f32
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].
Sourcepub fn enrich(&self, ir: &mut CausalIR) -> Vec<InferenceNote>
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 == Inferredviaattributes.entity(lookup NOUN dans les taxonomies). - Passe 2 : snapshot
NodeId → NodeTypepost-passe 1. - Passe 3 : recalibrage de confiance des arêtes implicites ; signalement des lacunes causales (Concession / Opposition).
Auto Trait Implementations§
impl Freeze for InferenceEngine
impl RefUnwindSafe for InferenceEngine
impl Send for InferenceEngine
impl Sync for InferenceEngine
impl Unpin for InferenceEngine
impl UnsafeUnpin for InferenceEngine
impl UnwindSafe for InferenceEngine
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
Mutably borrows from an owned value. Read more