pub struct TunedTagger { /* private fields */ }Expand description
A tuned tagger ready for inference: weights + the label spaces they were trained with.
Implementations§
Source§impl TunedTagger
impl TunedTagger
Sourcepub fn load(
dir: &Path,
base_dir: &Path,
tokenizer: &Path,
max_len: usize,
) -> Result<TunedTagger, String>
pub fn load( dir: &Path, base_dir: &Path, tokenizer: &Path, max_len: usize, ) -> Result<TunedTagger, String>
Load from a save() directory (tagger.safetensors + tagger.json) plus the base config and a
tokenizer. The label space comes from the checkpoint, never from a hardcoded list, so a model
trained on a different corpus’s spec decodes correctly.
pub fn labels(&self) -> &[String]
Sourcepub fn enable_relations(
&mut self,
dir: &Path,
spec: &VocabularySpace,
) -> Result<(), String>
pub fn enable_relations( &mut self, dir: &Path, spec: &VocabularySpace, ) -> Result<(), String>
Attach the trained biaffine relation head (Head C) so projection binds arguments and emits
dimension-2 tokens. dir is the checkpoint directory holding relations.safetensors.
pub fn has_relations(&self) -> bool
Sourcepub fn project(&self, sentence: &str) -> Result<Situation, String>
pub fn project(&self, sentence: &str) -> Result<Situation, String>
Project a sentence into a [Situation] for the roaring index — the bridge from the tuned tagger to
ingest. Emits the six Vocabulary-Space dimensions this tagger can produce:
- dim 1 typed entity tokens (
org/raytheon) from Head A’s facets - dim 3
geo/…/time/…via the deterministic loci normalisers - dim 4
qty/…bucket URIs via the units canonicaliser - dim 5
state/negated/state/hedgedfrom a STATE cue span
Negation scope: an epistemic cue scopes its clause, so a state/negated cue sets negative
infon polarity on the other tokens of the sentence, not merely on the cue. That is what makes
Bel/Pl meaningful — “Raytheon does not manufacture Aegis” must not assert org/raytheon
positively about that relation.
Auto Trait Implementations§
impl !Freeze for TunedTagger
impl !RefUnwindSafe for TunedTagger
impl !UnwindSafe for TunedTagger
impl Send for TunedTagger
impl Sync for TunedTagger
impl Unpin for TunedTagger
impl UnsafeUnpin for TunedTagger
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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> ⓘ
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